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/policy/auto_enrollment_client.h" | 5 #include "chrome/browser/policy/auto_enrollment_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 device_management_service_(service), | 85 device_management_service_(service), |
86 local_state_(local_state) { | 86 local_state_(local_state) { |
87 DCHECK_LE(power_initial_, power_limit_); | 87 DCHECK_LE(power_initial_, power_limit_); |
88 if (!serial_number.empty()) | 88 if (!serial_number.empty()) |
89 serial_number_hash_ = crypto::SHA256HashString(serial_number); | 89 serial_number_hash_ = crypto::SHA256HashString(serial_number); |
90 } | 90 } |
91 | 91 |
92 AutoEnrollmentClient::~AutoEnrollmentClient() {} | 92 AutoEnrollmentClient::~AutoEnrollmentClient() {} |
93 | 93 |
94 // static | 94 // static |
95 void AutoEnrollmentClient::RegisterPrefs(PrefServiceSimple* local_state) { | 95 void AutoEnrollmentClient::RegisterPrefs(PrefRegistrarSimple* local_state) { |
96 local_state->RegisterBooleanPref(prefs::kShouldAutoEnroll, false); | 96 local_state->RegisterBooleanPref(prefs::kShouldAutoEnroll, false); |
97 local_state->RegisterIntegerPref(prefs::kAutoEnrollmentPowerLimit, -1); | 97 local_state->RegisterIntegerPref(prefs::kAutoEnrollmentPowerLimit, -1); |
98 } | 98 } |
99 | 99 |
100 // static | 100 // static |
101 bool AutoEnrollmentClient::IsDisabled() { | 101 bool AutoEnrollmentClient::IsDisabled() { |
102 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 102 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
103 return | 103 return |
104 !command_line->HasSwitch(switches::kEnterpriseEnrollmentInitialModulus) && | 104 !command_line->HasSwitch(switches::kEnterpriseEnrollmentInitialModulus) && |
105 !command_line->HasSwitch(switches::kEnterpriseEnrollmentModulusLimit); | 105 !command_line->HasSwitch(switches::kEnterpriseEnrollmentModulusLimit); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // This samples |kZero| when there was no need for extra time, so that we can | 327 // This samples |kZero| when there was no need for extra time, so that we can |
328 // measure the ratio of users that succeeded without needing a delay to the | 328 // measure the ratio of users that succeeded without needing a delay to the |
329 // total users going through OOBE. | 329 // total users going through OOBE. |
330 UMA_HISTOGRAM_CUSTOM_TIMES(kExtraTime, delta, kMin, kMax, kBuckets); | 330 UMA_HISTOGRAM_CUSTOM_TIMES(kExtraTime, delta, kMin, kMax, kBuckets); |
331 | 331 |
332 if (!completion_callback_.is_null()) | 332 if (!completion_callback_.is_null()) |
333 completion_callback_.Run(); | 333 completion_callback_.Run(); |
334 } | 334 } |
335 | 335 |
336 } // namespace policy | 336 } // namespace policy |
OLD | NEW |