| 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/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 DeviceManagementService* device_management_service, | 125 DeviceManagementService* device_management_service, |
| 126 scoped_refptr<net::URLRequestContextGetter> system_request_context) { | 126 scoped_refptr<net::URLRequestContextGetter> system_request_context) { |
| 127 DCHECK(device_management_service); | 127 DCHECK(device_management_service); |
| 128 DCHECK(local_state); | 128 DCHECK(local_state); |
| 129 local_state_ = local_state; | 129 local_state_ = local_state; |
| 130 // Note: |system_request_context| can be null for tests. | 130 // Note: |system_request_context| can be null for tests. |
| 131 // Use the system request context here instead of a context derived | 131 // Use the system request context here instead of a context derived |
| 132 // from the Profile because Connect() is called before the profile is | 132 // from the Profile because Connect() is called before the profile is |
| 133 // fully initialized (required so we can perform the initial policy load). | 133 // fully initialized (required so we can perform the initial policy load). |
| 134 std::unique_ptr<CloudPolicyClient> cloud_policy_client(new CloudPolicyClient( | 134 std::unique_ptr<CloudPolicyClient> cloud_policy_client(new CloudPolicyClient( |
| 135 std::string(), std::string(), kPolicyVerificationKeyHash, | 135 std::string(), std::string(), device_management_service, |
| 136 device_management_service, system_request_context, | 136 system_request_context, nullptr /* signing_service */)); |
| 137 nullptr /* signing_service */)); | |
| 138 CreateComponentCloudPolicyService( | 137 CreateComponentCloudPolicyService( |
| 139 dm_protocol::kChromeExtensionPolicyType, component_policy_cache_path_, | 138 dm_protocol::kChromeExtensionPolicyType, component_policy_cache_path_, |
| 140 system_request_context, cloud_policy_client.get(), schema_registry()); | 139 system_request_context, cloud_policy_client.get(), schema_registry()); |
| 141 core()->Connect(std::move(cloud_policy_client)); | 140 core()->Connect(std::move(cloud_policy_client)); |
| 142 client()->AddObserver(this); | 141 client()->AddObserver(this); |
| 143 | 142 |
| 144 external_data_manager_->Connect(system_request_context); | 143 external_data_manager_->Connect(system_request_context); |
| 145 | 144 |
| 146 // Determine the next step after the CloudPolicyService initializes. | 145 // Determine the next step after the CloudPolicyService initializes. |
| 147 if (service()->IsInitializationComplete()) { | 146 if (service()->IsInitializationComplete()) { |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // OnComponentCloudPolicyUpdated() once it's ready. | 447 // OnComponentCloudPolicyUpdated() once it's ready. |
| 449 return; | 448 return; |
| 450 } | 449 } |
| 451 | 450 |
| 452 core()->StartRefreshScheduler(); | 451 core()->StartRefreshScheduler(); |
| 453 core()->TrackRefreshDelayPref(local_state_, | 452 core()->TrackRefreshDelayPref(local_state_, |
| 454 policy_prefs::kUserPolicyRefreshRate); | 453 policy_prefs::kUserPolicyRefreshRate); |
| 455 } | 454 } |
| 456 | 455 |
| 457 } // namespace policy | 456 } // namespace policy |
| OLD | NEW |