| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 scoped_ptr<PolicyService> service(new PolicyServiceImpl(providers)); | 531 scoped_ptr<PolicyService> service(new PolicyServiceImpl(providers)); |
| 532 service->RegisterPolicyDomain(POLICY_DOMAIN_CHROME, std::set<std::string>()); | 532 service->RegisterPolicyDomain(POLICY_DOMAIN_CHROME, std::set<std::string>()); |
| 533 return service.Pass(); | 533 return service.Pass(); |
| 534 } | 534 } |
| 535 | 535 |
| 536 // static | 536 // static |
| 537 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { | 537 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { |
| 538 #if defined(OS_WIN) | 538 #if defined(OS_WIN) |
| 539 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | 539 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); |
| 540 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderWin(policy_list)); | 540 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create(policy_list)); |
| 541 return new AsyncPolicyProvider(loader.Pass()); | 541 return new AsyncPolicyProvider(loader.Pass()); |
| 542 #elif defined(OS_MACOSX) | 542 #elif defined(OS_MACOSX) |
| 543 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | 543 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); |
| 544 scoped_ptr<AsyncPolicyLoader> loader( | 544 scoped_ptr<AsyncPolicyLoader> loader( |
| 545 new PolicyLoaderMac(policy_list, new MacPreferences())); | 545 new PolicyLoaderMac(policy_list, new MacPreferences())); |
| 546 return new AsyncPolicyProvider(loader.Pass()); | 546 return new AsyncPolicyProvider(loader.Pass()); |
| 547 #elif defined(OS_POSIX) | 547 #elif defined(OS_POSIX) |
| 548 base::FilePath config_dir_path; | 548 base::FilePath config_dir_path; |
| 549 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { | 549 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { |
| 550 scoped_ptr<AsyncPolicyLoader> loader( | 550 scoped_ptr<AsyncPolicyLoader> loader( |
| 551 new ConfigDirPolicyLoader(config_dir_path, POLICY_SCOPE_MACHINE)); | 551 new ConfigDirPolicyLoader(config_dir_path, POLICY_SCOPE_MACHINE)); |
| 552 return new AsyncPolicyProvider(loader.Pass()); | 552 return new AsyncPolicyProvider(loader.Pass()); |
| 553 } else { | 553 } else { |
| 554 return NULL; | 554 return NULL; |
| 555 } | 555 } |
| 556 #else | 556 #else |
| 557 return NULL; | 557 return NULL; |
| 558 #endif | 558 #endif |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace policy | 561 } // namespace policy |
| OLD | NEW |