Chromium Code Reviews| 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 27 matching lines...) Expand all Loading... | |
| 38 #include "chrome/common/chrome_version_info.h" | 38 #include "chrome/common/chrome_version_info.h" |
| 39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 40 #include "components/policy/core/common/policy_pref_names.h" | 40 #include "components/policy/core/common/policy_pref_names.h" |
| 41 #include "components/policy/core/common/schema.h" | 41 #include "components/policy/core/common/schema.h" |
| 42 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 43 #include "content/public/common/content_client.h" | 43 #include "content/public/common/content_client.h" |
| 44 #include "google_apis/gaia/gaia_auth_util.h" | 44 #include "google_apis/gaia/gaia_auth_util.h" |
| 45 #include "google_apis/gaia/gaia_constants.h" | 45 #include "google_apis/gaia/gaia_constants.h" |
| 46 #include "grit/generated_resources.h" | 46 #include "grit/generated_resources.h" |
| 47 #include "net/url_request/url_request_context_getter.h" | 47 #include "net/url_request/url_request_context_getter.h" |
| 48 #include "policy/policy_constants.h" | 48 #include "policy/policy_constants.h" |
|
bartfab (slow)
2013/11/05 18:18:33
Nit: policy/policy_constants.h now implicitly pull
Joao da Silva
2013/11/07 20:27:27
policy_constants.h is not pulling callback_forward
| |
| 49 #include "third_party/icu/source/i18n/unicode/regex.h" | 49 #include "third_party/icu/source/i18n/unicode/regex.h" |
| 50 #include "url/gurl.h" | 50 #include "url/gurl.h" |
| 51 | 51 |
| 52 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
| 53 #include "chrome/browser/policy/policy_loader_win.h" | 53 #include "chrome/browser/policy/policy_loader_win.h" |
| 54 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 54 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 55 #include <CoreFoundation/CoreFoundation.h> | 55 #include <CoreFoundation/CoreFoundation.h> |
| 56 #include "chrome/browser/policy/policy_loader_mac.h" | 56 #include "chrome/browser/policy/policy_loader_mac.h" |
| 57 #include "chrome/browser/policy/preferences_mac.h" | 57 #include "chrome/browser/policy/preferences_mac.h" |
| 58 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 58 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 device_management_service_.get()); | 321 device_management_service_.get()); |
| 322 } | 322 } |
| 323 | 323 |
| 324 GetAppPackUpdater(); | 324 GetAppPackUpdater(); |
| 325 | 325 |
| 326 SetTimezoneIfPolicyAvailable(); | 326 SetTimezoneIfPolicyAvailable(); |
| 327 #endif | 327 #endif |
| 328 | 328 |
| 329 policy_statistics_collector_.reset( | 329 policy_statistics_collector_.reset( |
| 330 new policy::PolicyStatisticsCollector( | 330 new policy::PolicyStatisticsCollector( |
| 331 base::Bind(&GetChromePolicyDetails), | |
| 332 GetChromeSchema(), | |
| 331 GetPolicyService(), | 333 GetPolicyService(), |
| 332 local_state_, | 334 local_state_, |
| 333 base::MessageLoop::current()->message_loop_proxy())); | 335 base::MessageLoop::current()->message_loop_proxy())); |
| 334 policy_statistics_collector_->Initialize(); | 336 policy_statistics_collector_->Initialize(); |
| 335 | 337 |
| 336 #if defined(OS_CHROMEOS) | 338 #if defined(OS_CHROMEOS) |
| 337 network_configuration_updater_ = | 339 network_configuration_updater_ = |
| 338 NetworkConfigurationUpdater::CreateForDevicePolicy( | 340 NetworkConfigurationUpdater::CreateForDevicePolicy( |
| 339 scoped_ptr<chromeos::onc::CertificateImporter>( | 341 scoped_ptr<chromeos::onc::CertificateImporter>( |
| 340 new chromeos::onc::CertificateImporterImpl), | 342 new chromeos::onc::CertificateImporterImpl), |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 &timezone) && | 574 &timezone) && |
| 573 !timezone.empty()) { | 575 !timezone.empty()) { |
| 574 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 576 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 575 UTF8ToUTF16(timezone)); | 577 UTF8ToUTF16(timezone)); |
| 576 } | 578 } |
| 577 #endif | 579 #endif |
| 578 } | 580 } |
| 579 | 581 |
| 580 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { | 582 ConfigurationPolicyProvider* BrowserPolicyConnector::CreatePlatformProvider() { |
| 581 #if defined(OS_WIN) | 583 #if defined(OS_WIN) |
| 582 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | |
| 583 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( | 584 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( |
| 584 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 585 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 585 policy_list)); | |
| 586 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 586 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
| 587 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 587 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 588 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); | |
| 589 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( | 588 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( |
| 590 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 589 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
| 591 policy_list, | |
| 592 GetManagedPolicyPath(), | 590 GetManagedPolicyPath(), |
| 593 new MacPreferences())); | 591 new MacPreferences())); |
| 594 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 592 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
| 595 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 593 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
| 596 base::FilePath config_dir_path; | 594 base::FilePath config_dir_path; |
| 597 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { | 595 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { |
| 598 scoped_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( | 596 scoped_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( |
| 599 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 597 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
| 600 config_dir_path, | 598 config_dir_path, |
| 601 POLICY_SCOPE_MACHINE)); | 599 POLICY_SCOPE_MACHINE)); |
| 602 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 600 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
| 603 } else { | 601 } else { |
| 604 return NULL; | 602 return NULL; |
| 605 } | 603 } |
| 606 #else | 604 #else |
| 607 return NULL; | 605 return NULL; |
| 608 #endif | 606 #endif |
| 609 } | 607 } |
| 610 | 608 |
| 611 } // namespace policy | 609 } // namespace policy |
| OLD | NEW |