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/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 void DeviceCloudPolicyManagerChromeOS::StartConnection( | 237 void DeviceCloudPolicyManagerChromeOS::StartConnection( |
238 std::unique_ptr<CloudPolicyClient> client_to_connect, | 238 std::unique_ptr<CloudPolicyClient> client_to_connect, |
239 chromeos::InstallAttributes* install_attributes) { | 239 chromeos::InstallAttributes* install_attributes) { |
240 CHECK(!service()); | 240 CHECK(!service()); |
241 | 241 |
242 // Set state keys here so the first policy fetch submits them to the server. | 242 // Set state keys here so the first policy fetch submits them to the server. |
243 if (ForcedReEnrollmentEnabled()) | 243 if (ForcedReEnrollmentEnabled()) |
244 client_to_connect->SetStateKeysToUpload(state_keys_broker_->state_keys()); | 244 client_to_connect->SetStateKeysToUpload(state_keys_broker_->state_keys()); |
245 | 245 |
246 if (is_component_policy_enabled_) { | 246 // Create the component cloud policy service for fetching, caching and |
| 247 // exposing policy for extensions. |
| 248 if (!component_policy_disabled_for_testing_) { |
247 base::FilePath component_policy_cache_dir; | 249 base::FilePath component_policy_cache_dir; |
248 CHECK(PathService::Get(chromeos::DIR_SIGNIN_PROFILE_COMPONENT_POLICY, | 250 CHECK(PathService::Get(chromeos::DIR_SIGNIN_PROFILE_COMPONENT_POLICY, |
249 &component_policy_cache_dir)); | 251 &component_policy_cache_dir)); |
250 CHECK(signin_profile_forwarding_schema_registry_); | 252 CHECK(signin_profile_forwarding_schema_registry_); |
251 CreateComponentCloudPolicyService( | 253 CreateComponentCloudPolicyService( |
252 dm_protocol::kChromeSigninExtensionPolicyType, | 254 dm_protocol::kChromeSigninExtensionPolicyType, |
253 component_policy_cache_dir, g_browser_process->system_request_context(), | 255 component_policy_cache_dir, g_browser_process->system_request_context(), |
254 client_to_connect.get(), | 256 client_to_connect.get(), |
255 signin_profile_forwarding_schema_registry_.get()); | 257 signin_profile_forwarding_schema_registry_.get()); |
256 } | 258 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 base::MakeUnique<DeviceStatusCollector>( | 365 base::MakeUnique<DeviceStatusCollector>( |
364 local_state_, chromeos::system::StatisticsProvider::GetInstance(), | 366 local_state_, chromeos::system::StatisticsProvider::GetInstance(), |
365 DeviceStatusCollector::VolumeInfoFetcher(), | 367 DeviceStatusCollector::VolumeInfoFetcher(), |
366 DeviceStatusCollector::CPUStatisticsFetcher(), | 368 DeviceStatusCollector::CPUStatisticsFetcher(), |
367 DeviceStatusCollector::CPUTempFetcher(), | 369 DeviceStatusCollector::CPUTempFetcher(), |
368 DeviceStatusCollector::AndroidStatusFetcher()), | 370 DeviceStatusCollector::AndroidStatusFetcher()), |
369 task_runner_)); | 371 task_runner_)); |
370 } | 372 } |
371 | 373 |
372 } // namespace policy | 374 } // namespace policy |
OLD | NEW |