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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 if (token_fetcher_->has_oauth2_tokens()) | 227 if (token_fetcher_->has_oauth2_tokens()) |
228 oauth2_login_tokens_ = token_fetcher_->oauth2_tokens(); | 228 oauth2_login_tokens_ = token_fetcher_->oauth2_tokens(); |
229 | 229 |
230 if (policy_token.empty()) { | 230 if (policy_token.empty()) { |
231 // Failed to get a token, stop waiting and use an empty policy. | 231 // Failed to get a token, stop waiting and use an empty policy. |
232 CancelWaitForPolicyFetch(); | 232 CancelWaitForPolicyFetch(); |
233 } else { | 233 } else { |
234 // Start client registration. Either OnRegistrationStateChanged() or | 234 // Start client registration. Either OnRegistrationStateChanged() or |
235 // OnClientError() will be called back. | 235 // OnClientError() will be called back. |
236 client()->Register(em::DeviceRegisterRequest::USER, | 236 client()->Register(em::DeviceRegisterRequest::USER, |
237 policy_token, std::string(), false); | 237 policy_token, std::string(), false, std::string()); |
238 } | 238 } |
239 | 239 |
240 token_fetcher_.reset(); | 240 token_fetcher_.reset(); |
241 } | 241 } |
242 | 242 |
243 void UserCloudPolicyManagerChromeOS::OnInitialPolicyFetchComplete( | 243 void UserCloudPolicyManagerChromeOS::OnInitialPolicyFetchComplete( |
244 bool success) { | 244 bool success) { |
245 CancelWaitForPolicyFetch(); | 245 CancelWaitForPolicyFetch(); |
246 } | 246 } |
247 | 247 |
(...skipping 21 matching lines...) Expand all Loading... |
269 // start the scheduler. The |component_policy_service_| will call back into | 269 // start the scheduler. The |component_policy_service_| will call back into |
270 // OnComponentCloudPolicyUpdated() once it's ready. | 270 // OnComponentCloudPolicyUpdated() once it's ready. |
271 return; | 271 return; |
272 } | 272 } |
273 | 273 |
274 core()->StartRefreshScheduler(); | 274 core()->StartRefreshScheduler(); |
275 core()->TrackRefreshDelayPref(local_state_, prefs::kUserPolicyRefreshRate); | 275 core()->TrackRefreshDelayPref(local_state_, prefs::kUserPolicyRefreshRate); |
276 } | 276 } |
277 | 277 |
278 } // namespace policy | 278 } // namespace policy |
OLD | NEW |