Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: chrome/browser/chromeos/policy/auto_enrollment_client.cc

Issue 477243003: Revert of Minor cleanup of EnrollmentHandlerChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698