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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // fully initialized (required so we can perform the initial policy load). | 119 // fully initialized (required so we can perform the initial policy load). |
120 // TODO(atwilson): Change this to use a UserPolicyRequestContext once | 120 // TODO(atwilson): Change this to use a UserPolicyRequestContext once |
121 // Connect() is called after profile initialization. http://crbug.com/323591 | 121 // Connect() is called after profile initialization. http://crbug.com/323591 |
122 request_context = new SystemPolicyRequestContext( | 122 request_context = new SystemPolicyRequestContext( |
123 system_request_context, GetUserAgent()); | 123 system_request_context, GetUserAgent()); |
124 } | 124 } |
125 scoped_ptr<CloudPolicyClient> cloud_policy_client( | 125 scoped_ptr<CloudPolicyClient> cloud_policy_client( |
126 new CloudPolicyClient(std::string(), std::string(), | 126 new CloudPolicyClient(std::string(), std::string(), |
127 kPolicyVerificationKeyHash, user_affiliation, | 127 kPolicyVerificationKeyHash, user_affiliation, |
128 device_management_service, request_context)); | 128 device_management_service, request_context)); |
| 129 CreateComponentCloudPolicyService(component_policy_cache_path_, |
| 130 request_context, cloud_policy_client.get()); |
129 core()->Connect(cloud_policy_client.Pass()); | 131 core()->Connect(cloud_policy_client.Pass()); |
130 client()->AddObserver(this); | 132 client()->AddObserver(this); |
131 | 133 |
132 external_data_manager_->Connect(request_context); | 134 external_data_manager_->Connect(request_context); |
133 | 135 |
134 CreateComponentCloudPolicyService(component_policy_cache_path_, | |
135 request_context); | |
136 | |
137 // Determine the next step after the CloudPolicyService initializes. | 136 // Determine the next step after the CloudPolicyService initializes. |
138 if (service()->IsInitializationComplete()) { | 137 if (service()->IsInitializationComplete()) { |
139 OnInitializationCompleted(service()); | 138 OnInitializationCompleted(service()); |
140 } else { | 139 } else { |
141 service()->AddObserver(this); | 140 service()->AddObserver(this); |
142 } | 141 } |
143 } | 142 } |
144 | 143 |
145 void UserCloudPolicyManagerChromeOS::OnAccessTokenAvailable( | 144 void UserCloudPolicyManagerChromeOS::OnAccessTokenAvailable( |
146 const std::string& access_token) { | 145 const std::string& access_token) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // OnComponentCloudPolicyUpdated() once it's ready. | 384 // OnComponentCloudPolicyUpdated() once it's ready. |
386 return; | 385 return; |
387 } | 386 } |
388 | 387 |
389 core()->StartRefreshScheduler(); | 388 core()->StartRefreshScheduler(); |
390 core()->TrackRefreshDelayPref(local_state_, | 389 core()->TrackRefreshDelayPref(local_state_, |
391 policy_prefs::kUserPolicyRefreshRate); | 390 policy_prefs::kUserPolicyRefreshRate); |
392 } | 391 } |
393 | 392 |
394 } // namespace policy | 393 } // namespace policy |
OLD | NEW |