| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 if (wait_for_policy_fetch_) { | 407 if (wait_for_policy_fetch_) { |
| 408 UMA_HISTOGRAM_MEDIUM_TIMES(kUMAInitialFetchDelayOAuth2Token, | 408 UMA_HISTOGRAM_MEDIUM_TIMES(kUMAInitialFetchDelayOAuth2Token, |
| 409 time_token_available_ - time_init_completed_); | 409 time_token_available_ - time_init_completed_); |
| 410 } | 410 } |
| 411 | 411 |
| 412 if (error.state() == GoogleServiceAuthError::NONE) { | 412 if (error.state() == GoogleServiceAuthError::NONE) { |
| 413 // Start client registration. Either OnRegistrationStateChanged() or | 413 // Start client registration. Either OnRegistrationStateChanged() or |
| 414 // OnClientError() will be called back. | 414 // OnClientError() will be called back. |
| 415 client()->Register(em::DeviceRegisterRequest::USER, | 415 client()->Register(em::DeviceRegisterRequest::USER, |
| 416 em::DeviceRegisterRequest::FLAVOR_USER_REGISTRATION, | 416 em::DeviceRegisterRequest::FLAVOR_USER_REGISTRATION, |
| 417 policy_token, std::string(), std::string(), | 417 em::LicenseType::UNDEFINED, policy_token, std::string(), |
| 418 std::string()); | 418 std::string(), std::string()); |
| 419 } else { | 419 } else { |
| 420 UMA_HISTOGRAM_ENUMERATION(kUMAInitialFetchOAuth2Error, | 420 UMA_HISTOGRAM_ENUMERATION(kUMAInitialFetchOAuth2Error, |
| 421 error.state(), | 421 error.state(), |
| 422 GoogleServiceAuthError::NUM_STATES); | 422 GoogleServiceAuthError::NUM_STATES); |
| 423 if (error.state() == GoogleServiceAuthError::CONNECTION_FAILED) { | 423 if (error.state() == GoogleServiceAuthError::CONNECTION_FAILED) { |
| 424 // Network errors are negative in the code, but the histogram data type | 424 // Network errors are negative in the code, but the histogram data type |
| 425 // expects the corresponding positive value. | 425 // expects the corresponding positive value. |
| 426 UMA_HISTOGRAM_SPARSE_SLOWLY(kUMAInitialFetchOAuth2NetworkError, | 426 UMA_HISTOGRAM_SPARSE_SLOWLY(kUMAInitialFetchOAuth2NetworkError, |
| 427 -error.network_error()); | 427 -error.network_error()); |
| 428 } | 428 } |
| (...skipping 65 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 |