| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 device_management_service_.get()); | 328 device_management_service_.get()); |
| 329 } | 329 } |
| 330 | 330 |
| 331 GetAppPackUpdater(); | 331 GetAppPackUpdater(); |
| 332 | 332 |
| 333 SetTimezoneIfPolicyAvailable(); | 333 SetTimezoneIfPolicyAvailable(); |
| 334 #endif | 334 #endif |
| 335 | 335 |
| 336 policy_statistics_collector_.reset( | 336 policy_statistics_collector_.reset( |
| 337 new policy::PolicyStatisticsCollector( | 337 new policy::PolicyStatisticsCollector( |
| 338 base::Bind(&GetChromePolicyDetails), |
| 339 GetChromeSchema(), |
| 338 GetPolicyService(), | 340 GetPolicyService(), |
| 339 local_state_, | 341 local_state_, |
| 340 base::MessageLoop::current()->message_loop_proxy())); | 342 base::MessageLoop::current()->message_loop_proxy())); |
| 341 policy_statistics_collector_->Initialize(); | 343 policy_statistics_collector_->Initialize(); |
| 342 | 344 |
| 343 #if defined(OS_CHROMEOS) | 345 #if defined(OS_CHROMEOS) |
| 344 network_configuration_updater_ = | 346 network_configuration_updater_ = |
| 345 NetworkConfigurationUpdater::CreateForDevicePolicy( | 347 NetworkConfigurationUpdater::CreateForDevicePolicy( |
| 346 scoped_ptr<chromeos::onc::CertificateImporter>( | 348 scoped_ptr<chromeos::onc::CertificateImporter>( |
| 347 new chromeos::onc::CertificateImporterImpl), | 349 new chromeos::onc::CertificateImporterImpl), |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 &timezone) && | 581 &timezone) && |
| 580 !timezone.empty()) { | 582 !timezone.empty()) { |
| 581 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 583 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 582 UTF8ToUTF16(timezone)); | 584 UTF8ToUTF16(timezone)); |
| 583 } | 585 } |
| 584 #endif | 586 #endif |
| 585 } | 587 } |
| 586 | 588 |
| 587 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { | 589 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { |
| 588 #if defined(OS_WIN) | 590 #if defined(OS_WIN) |
| 589 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | |
| 590 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( | 591 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( |
| 591 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 592 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 592 policy_list)); | |
| 593 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 593 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
| 594 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 594 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 595 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | |
| 596 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( | 595 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( |
| 597 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 596 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
| 598 policy_list, | |
| 599 GetManagedPolicyPath(), | 597 GetManagedPolicyPath(), |
| 600 new MacPreferences())); | 598 new MacPreferences())); |
| 601 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 599 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
| 602 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 600 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
| 603 base::FilePath config_dir_path; | 601 base::FilePath config_dir_path; |
| 604 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { | 602 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { |
| 605 scoped_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( | 603 scoped_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( |
| 606 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 604 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
| 607 config_dir_path, | 605 config_dir_path, |
| 608 POLICY_SCOPE_MACHINE)); | 606 POLICY_SCOPE_MACHINE)); |
| 609 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 607 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
| 610 } else { | 608 } else { |
| 611 return NULL; | 609 return NULL; |
| 612 } | 610 } |
| 613 #else | 611 #else |
| 614 return NULL; | 612 return NULL; |
| 615 #endif | 613 #endif |
| 616 } | 614 } |
| 617 | 615 |
| 618 } // namespace policy | 616 } // namespace policy |
| OLD | NEW |