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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 if (waiting_for_initial_policy_fetch_) { | 406 if (waiting_for_initial_policy_fetch_) { |
407 UMA_HISTOGRAM_MEDIUM_TIMES(kUMAInitialFetchDelayOAuth2Token, | 407 UMA_HISTOGRAM_MEDIUM_TIMES(kUMAInitialFetchDelayOAuth2Token, |
408 time_token_available_ - time_init_completed_); | 408 time_token_available_ - time_init_completed_); |
409 } | 409 } |
410 | 410 |
411 if (error.state() == GoogleServiceAuthError::NONE) { | 411 if (error.state() == GoogleServiceAuthError::NONE) { |
412 // Start client registration. Either OnRegistrationStateChanged() or | 412 // Start client registration. Either OnRegistrationStateChanged() or |
413 // OnClientError() will be called back. | 413 // OnClientError() will be called back. |
414 client()->Register(em::DeviceRegisterRequest::USER, | 414 client()->Register(em::DeviceRegisterRequest::USER, |
415 em::DeviceRegisterRequest::FLAVOR_USER_REGISTRATION, | 415 em::DeviceRegisterRequest::FLAVOR_USER_REGISTRATION, |
416 policy_token, std::string(), std::string(), | 416 em::LicenseType::UNDEFINED, policy_token, std::string(), |
417 std::string()); | 417 std::string(), std::string()); |
418 } else { | 418 } else { |
419 UMA_HISTOGRAM_ENUMERATION(kUMAInitialFetchOAuth2Error, | 419 UMA_HISTOGRAM_ENUMERATION(kUMAInitialFetchOAuth2Error, |
420 error.state(), | 420 error.state(), |
421 GoogleServiceAuthError::NUM_STATES); | 421 GoogleServiceAuthError::NUM_STATES); |
422 if (error.state() == GoogleServiceAuthError::CONNECTION_FAILED) { | 422 if (error.state() == GoogleServiceAuthError::CONNECTION_FAILED) { |
423 // Network errors are negative in the code, but the histogram data type | 423 // Network errors are negative in the code, but the histogram data type |
424 // expects the corresponding positive value. | 424 // expects the corresponding positive value. |
425 UMA_HISTOGRAM_SPARSE_SLOWLY(kUMAInitialFetchOAuth2NetworkError, | 425 UMA_HISTOGRAM_SPARSE_SLOWLY(kUMAInitialFetchOAuth2NetworkError, |
426 -error.network_error()); | 426 -error.network_error()); |
427 } | 427 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 // OnComponentCloudPolicyUpdated() once it's ready. | 494 // OnComponentCloudPolicyUpdated() once it's ready. |
495 return; | 495 return; |
496 } | 496 } |
497 | 497 |
498 core()->StartRefreshScheduler(); | 498 core()->StartRefreshScheduler(); |
499 core()->TrackRefreshDelayPref(local_state_, | 499 core()->TrackRefreshDelayPref(local_state_, |
500 policy_prefs::kUserPolicyRefreshRate); | 500 policy_prefs::kUserPolicyRefreshRate); |
501 } | 501 } |
502 | 502 |
503 } // namespace policy | 503 } // namespace policy |
OLD | NEW |