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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 560 |
561 scoped_ptr<PolicyService> service(new PolicyServiceImpl(providers)); | 561 scoped_ptr<PolicyService> service(new PolicyServiceImpl(providers)); |
562 service->RegisterPolicyDomain(POLICY_DOMAIN_CHROME, std::set<std::string>()); | 562 service->RegisterPolicyDomain(POLICY_DOMAIN_CHROME, std::set<std::string>()); |
563 return service.Pass(); | 563 return service.Pass(); |
564 } | 564 } |
565 | 565 |
566 // static | 566 // static |
567 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { | 567 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { |
568 #if defined(OS_WIN) | 568 #if defined(OS_WIN) |
569 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | 569 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); |
570 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderWin(policy_list)); | 570 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create(policy_list)); |
571 return new AsyncPolicyProvider(loader.Pass()); | 571 return new AsyncPolicyProvider(loader.Pass()); |
572 #elif defined(OS_MACOSX) | 572 #elif defined(OS_MACOSX) |
573 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | 573 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); |
574 scoped_ptr<AsyncPolicyLoader> loader( | 574 scoped_ptr<AsyncPolicyLoader> loader( |
575 new PolicyLoaderMac(policy_list, new MacPreferences())); | 575 new PolicyLoaderMac(policy_list, new MacPreferences())); |
576 return new AsyncPolicyProvider(loader.Pass()); | 576 return new AsyncPolicyProvider(loader.Pass()); |
577 #elif defined(OS_POSIX) | 577 #elif defined(OS_POSIX) |
578 base::FilePath config_dir_path; | 578 base::FilePath config_dir_path; |
579 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { | 579 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { |
580 scoped_ptr<AsyncPolicyLoader> loader( | 580 scoped_ptr<AsyncPolicyLoader> loader( |
581 new ConfigDirPolicyLoader(config_dir_path, POLICY_SCOPE_MACHINE)); | 581 new ConfigDirPolicyLoader(config_dir_path, POLICY_SCOPE_MACHINE)); |
582 return new AsyncPolicyProvider(loader.Pass()); | 582 return new AsyncPolicyProvider(loader.Pass()); |
583 } else { | 583 } else { |
584 return NULL; | 584 return NULL; |
585 } | 585 } |
586 #else | 586 #else |
587 return NULL; | 587 return NULL; |
588 #endif | 588 #endif |
589 } | 589 } |
590 | 590 |
591 } // namespace policy | 591 } // namespace policy |
OLD | NEW |