| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "chrome/browser/chromeos/login/user_manager.h" | 53 #include "chrome/browser/chromeos/login/user_manager.h" |
| 54 #include "chrome/browser/chromeos/policy/app_pack_updater.h" | 54 #include "chrome/browser/chromeos/policy/app_pack_updater.h" |
| 55 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 55 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| 56 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 56 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| 57 #include "chrome/browser/chromeos/policy/device_local_account.h" | 57 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 58 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 58 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 59 #include "chrome/browser/chromeos/policy/device_status_collector.h" | 59 #include "chrome/browser/chromeos/policy/device_status_collector.h" |
| 60 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" | 60 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" |
| 61 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" | 61 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
| 62 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl.h" | 62 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl.h" |
| 63 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl_cros
.h" |
| 63 #include "chrome/browser/chromeos/settings/cros_settings.h" | 64 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 64 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" | 65 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" |
| 65 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 66 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 66 #include "chrome/browser/chromeos/system/statistics_provider.h" | 67 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 67 #include "chrome/browser/chromeos/system/timezone_settings.h" | 68 #include "chrome/browser/chromeos/system/timezone_settings.h" |
| 68 #include "chromeos/chromeos_paths.h" | 69 #include "chromeos/chromeos_paths.h" |
| 69 #include "chromeos/chromeos_switches.h" | 70 #include "chromeos/chromeos_switches.h" |
| 70 #include "chromeos/cryptohome/cryptohome_library.h" | 71 #include "chromeos/cryptohome/cryptohome_library.h" |
| 71 #include "chromeos/dbus/cryptohome_client.h" | 72 #include "chromeos/dbus/cryptohome_client.h" |
| 72 #include "chromeos/dbus/dbus_thread_manager.h" | 73 #include "chromeos/dbus/dbus_thread_manager.h" |
| 73 #include "chromeos/network/certificate_handler.h" | |
| 74 #include "chromeos/network/managed_network_configuration_handler.h" | 74 #include "chromeos/network/managed_network_configuration_handler.h" |
| 75 #include "chromeos/network/onc/onc_certificate_importer_impl.h" |
| 75 #endif | 76 #endif |
| 76 | 77 |
| 77 using content::BrowserThread; | 78 using content::BrowserThread; |
| 78 | 79 |
| 79 namespace policy { | 80 namespace policy { |
| 80 | 81 |
| 81 namespace { | 82 namespace { |
| 82 | 83 |
| 83 // The following constants define delays applied before the initial policy fetch | 84 // The following constants define delays applied before the initial policy fetch |
| 84 // on startup. (So that displaying Chrome's GUI does not get delayed.) | 85 // on startup. (So that displaying Chrome's GUI does not get delayed.) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 #endif | 201 #endif |
| 201 | 202 |
| 202 policy_statistics_collector_.reset( | 203 policy_statistics_collector_.reset( |
| 203 new policy::PolicyStatisticsCollector( | 204 new policy::PolicyStatisticsCollector( |
| 204 GetPolicyService(), | 205 GetPolicyService(), |
| 205 local_state_, | 206 local_state_, |
| 206 base::MessageLoop::current()->message_loop_proxy())); | 207 base::MessageLoop::current()->message_loop_proxy())); |
| 207 policy_statistics_collector_->Initialize(); | 208 policy_statistics_collector_->Initialize(); |
| 208 | 209 |
| 209 #if defined(OS_CHROMEOS) | 210 #if defined(OS_CHROMEOS) |
| 210 network_configuration_updater_.reset( | 211 |
| 211 new NetworkConfigurationUpdaterImpl( | 212 network_configuration_updater_.reset(new NetworkConfigurationUpdaterImpl( |
| 212 GetPolicyService(), | 213 GetPolicyService(), |
| 213 make_scoped_ptr(new chromeos::CertificateHandler))); | 214 scoped_ptr<chromeos::onc::CertificateImporter>( |
| 215 new chromeos::onc::CertificateImporterImpl))); |
| 214 #endif | 216 #endif |
| 215 | 217 |
| 216 is_initialized_ = true; | 218 is_initialized_ = true; |
| 217 } | 219 } |
| 218 | 220 |
| 219 void BrowserPolicyConnector::Shutdown() { | 221 void BrowserPolicyConnector::Shutdown() { |
| 220 is_initialized_ = false; | 222 is_initialized_ = false; |
| 221 | 223 |
| 222 if (g_testing_provider) | 224 if (g_testing_provider) |
| 223 g_testing_provider->Shutdown(); | 225 g_testing_provider->Shutdown(); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 return new AsyncPolicyProvider(loader.Pass()); | 475 return new AsyncPolicyProvider(loader.Pass()); |
| 474 } else { | 476 } else { |
| 475 return NULL; | 477 return NULL; |
| 476 } | 478 } |
| 477 #else | 479 #else |
| 478 return NULL; | 480 return NULL; |
| 479 #endif | 481 #endif |
| 480 } | 482 } |
| 481 | 483 |
| 482 } // namespace policy | 484 } // namespace policy |
| OLD | NEW |