| 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/auto_enrollment_client.h" | 5 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 std::string ConvertRestoreMode( | 68 std::string ConvertRestoreMode( |
| 69 em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { | 69 em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { |
| 70 switch (restore_mode) { | 70 switch (restore_mode) { |
| 71 case em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE: | 71 case em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE: |
| 72 return std::string(); | 72 return std::string(); |
| 73 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_REQUESTED: | 73 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_REQUESTED: |
| 74 return kDeviceStateRestoreModeReEnrollmentRequested; | 74 return kDeviceStateRestoreModeReEnrollmentRequested; |
| 75 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED: | 75 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED: |
| 76 return kDeviceStateRestoreModeReEnrollmentEnforced; | 76 return kDeviceStateRestoreModeReEnrollmentEnforced; |
| 77 } | 77 } |
| 78 |
| 79 NOTREACHED() << "Bad restore mode " << restore_mode; |
| 80 return std::string(); |
| 78 } | 81 } |
| 79 | 82 |
| 80 } // namespace | 83 } // namespace |
| 81 | 84 |
| 82 AutoEnrollmentClient::AutoEnrollmentClient( | 85 AutoEnrollmentClient::AutoEnrollmentClient( |
| 83 const ProgressCallback& callback, | 86 const ProgressCallback& callback, |
| 84 DeviceManagementService* service, | 87 DeviceManagementService* service, |
| 85 PrefService* local_state, | 88 PrefService* local_state, |
| 86 scoped_refptr<net::URLRequestContextGetter> system_request_context, | 89 scoped_refptr<net::URLRequestContextGetter> system_request_context, |
| 87 const std::string& server_backed_state_key, | 90 const std::string& server_backed_state_key, |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 base::TimeDelta delta = kZero; | 443 base::TimeDelta delta = kZero; |
| 441 if (!time_extra_start_.is_null()) | 444 if (!time_extra_start_.is_null()) |
| 442 delta = now - time_extra_start_; | 445 delta = now - time_extra_start_; |
| 443 // This samples |kZero| when there was no need for extra time, so that we can | 446 // This samples |kZero| when there was no need for extra time, so that we can |
| 444 // measure the ratio of users that succeeded without needing a delay to the | 447 // measure the ratio of users that succeeded without needing a delay to the |
| 445 // total users going through OOBE. | 448 // total users going through OOBE. |
| 446 UMA_HISTOGRAM_CUSTOM_TIMES(kUMAExtraTime, delta, kMin, kMax, kBuckets); | 449 UMA_HISTOGRAM_CUSTOM_TIMES(kUMAExtraTime, delta, kMin, kMax, kBuckets); |
| 447 } | 450 } |
| 448 | 451 |
| 449 } // namespace policy | 452 } // namespace policy |
| OLD | NEW |