| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(), kPolicyVerificationKeyHash, |
| 136 device_management_service, system_request_context, | 136 device_management_service, system_request_context, |
| 137 nullptr /* signing_service */)); | 137 nullptr /* signing_service */)); |
| 138 CreateComponentCloudPolicyService(component_policy_cache_path_, | 138 CreateComponentCloudPolicyService( |
| 139 system_request_context, | 139 dm_protocol::kChromeExtensionPolicyType, component_policy_cache_path_, |
| 140 cloud_policy_client.get()); | 140 system_request_context, cloud_policy_client.get()); |
| 141 core()->Connect(std::move(cloud_policy_client)); | 141 core()->Connect(std::move(cloud_policy_client)); |
| 142 client()->AddObserver(this); | 142 client()->AddObserver(this); |
| 143 | 143 |
| 144 external_data_manager_->Connect(system_request_context); | 144 external_data_manager_->Connect(system_request_context); |
| 145 | 145 |
| 146 // Determine the next step after the CloudPolicyService initializes. | 146 // Determine the next step after the CloudPolicyService initializes. |
| 147 if (service()->IsInitializationComplete()) { | 147 if (service()->IsInitializationComplete()) { |
| 148 OnInitializationCompleted(service()); | 148 OnInitializationCompleted(service()); |
| 149 } else { | 149 } else { |
| 150 service()->AddObserver(this); | 150 service()->AddObserver(this); |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // OnComponentCloudPolicyUpdated() once it's ready. | 449 // OnComponentCloudPolicyUpdated() once it's ready. |
| 450 return; | 450 return; |
| 451 } | 451 } |
| 452 | 452 |
| 453 core()->StartRefreshScheduler(); | 453 core()->StartRefreshScheduler(); |
| 454 core()->TrackRefreshDelayPref(local_state_, | 454 core()->TrackRefreshDelayPref(local_state_, |
| 455 policy_prefs::kUserPolicyRefreshRate); | 455 policy_prefs::kUserPolicyRefreshRate); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace policy | 458 } // namespace policy |
| OLD | NEW |