| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 #if defined(OS_WIN) | 506 #if defined(OS_WIN) |
| 507 return new ConfigurationPolicyProviderWin(policy_list, | 507 return new ConfigurationPolicyProviderWin(policy_list, |
| 508 policy::kRegistryMandatorySubKey, | 508 policy::kRegistryMandatorySubKey, |
| 509 POLICY_LEVEL_MANDATORY); | 509 POLICY_LEVEL_MANDATORY); |
| 510 #elif defined(OS_MACOSX) | 510 #elif defined(OS_MACOSX) |
| 511 return new ConfigurationPolicyProviderMac(policy_list, | 511 return new ConfigurationPolicyProviderMac(policy_list, |
| 512 POLICY_LEVEL_MANDATORY); | 512 POLICY_LEVEL_MANDATORY); |
| 513 #elif defined(OS_POSIX) | 513 #elif defined(OS_POSIX) |
| 514 FilePath config_dir_path; | 514 FilePath config_dir_path; |
| 515 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { | 515 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { |
| 516 return new ConfigDirPolicyProvider( | 516 return new ConfigDirPolicyProvider(policy_list, |
| 517 policy_list, | 517 POLICY_SCOPE_MACHINE, |
| 518 POLICY_LEVEL_MANDATORY, | 518 config_dir_path); |
| 519 POLICY_SCOPE_MACHINE, | |
| 520 config_dir_path.Append(FILE_PATH_LITERAL("managed"))); | |
| 521 } else { | 519 } else { |
| 522 return NULL; | 520 return NULL; |
| 523 } | 521 } |
| 524 #else | 522 #else |
| 525 return NULL; | 523 return NULL; |
| 526 #endif | 524 #endif |
| 527 } | 525 } |
| 528 | 526 |
| 529 // static | 527 // static |
| 530 ConfigurationPolicyProvider* | 528 ConfigurationPolicyProvider* |
| 531 BrowserPolicyConnector::CreateRecommendedPlatformProvider() { | 529 BrowserPolicyConnector::CreateRecommendedPlatformProvider() { |
| 532 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | 530 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); |
| 533 #if defined(OS_WIN) | 531 #if defined(OS_WIN) |
| 534 return new ConfigurationPolicyProviderWin(policy_list, | 532 return new ConfigurationPolicyProviderWin(policy_list, |
| 535 policy::kRegistryRecommendedSubKey, | 533 policy::kRegistryRecommendedSubKey, |
| 536 POLICY_LEVEL_RECOMMENDED); | 534 POLICY_LEVEL_RECOMMENDED); |
| 537 #elif defined(OS_MACOSX) | 535 #elif defined(OS_MACOSX) |
| 538 return new ConfigurationPolicyProviderMac(policy_list, | 536 return new ConfigurationPolicyProviderMac(policy_list, |
| 539 POLICY_LEVEL_RECOMMENDED); | 537 POLICY_LEVEL_RECOMMENDED); |
| 540 #elif defined(OS_POSIX) | |
| 541 FilePath config_dir_path; | |
| 542 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { | |
| 543 return new ConfigDirPolicyProvider( | |
| 544 policy_list, | |
| 545 POLICY_LEVEL_RECOMMENDED, | |
| 546 POLICY_SCOPE_MACHINE, | |
| 547 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); | |
| 548 } else { | |
| 549 return NULL; | |
| 550 } | |
| 551 #else | 538 #else |
| 552 return NULL; | 539 return NULL; |
| 553 #endif | 540 #endif |
| 554 } | 541 } |
| 555 | 542 |
| 556 } // namespace policy | 543 } // namespace policy |
| OLD | NEW |