| 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(PrefService* local_state) { | 95 void AutoEnrollmentClient::RegisterPrefs(PrefServiceSimple* local_state) { |
| 96 local_state->RegisterBooleanPref(prefs::kShouldAutoEnroll, | 96 local_state->RegisterBooleanPref(prefs::kShouldAutoEnroll, false); |
| 97 false, | 97 local_state->RegisterIntegerPref(prefs::kAutoEnrollmentPowerLimit, -1); |
| 98 PrefService::UNSYNCABLE_PREF); | |
| 99 local_state->RegisterIntegerPref(prefs::kAutoEnrollmentPowerLimit, | |
| 100 -1, | |
| 101 PrefService::UNSYNCABLE_PREF); | |
| 102 } | 98 } |
| 103 | 99 |
| 104 // static | 100 // static |
| 105 bool AutoEnrollmentClient::IsDisabled() { | 101 bool AutoEnrollmentClient::IsDisabled() { |
| 106 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 102 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 107 return | 103 return |
| 108 !command_line->HasSwitch(switches::kEnterpriseEnrollmentInitialModulus) && | 104 !command_line->HasSwitch(switches::kEnterpriseEnrollmentInitialModulus) && |
| 109 !command_line->HasSwitch(switches::kEnterpriseEnrollmentModulusLimit); | 105 !command_line->HasSwitch(switches::kEnterpriseEnrollmentModulusLimit); |
| 110 } | 106 } |
| 111 | 107 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // 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 |
| 332 // 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 |
| 333 // total users going through OOBE. | 329 // total users going through OOBE. |
| 334 UMA_HISTOGRAM_CUSTOM_TIMES(kExtraTime, delta, kMin, kMax, kBuckets); | 330 UMA_HISTOGRAM_CUSTOM_TIMES(kExtraTime, delta, kMin, kMax, kBuckets); |
| 335 | 331 |
| 336 if (!completion_callback_.is_null()) | 332 if (!completion_callback_.is_null()) |
| 337 completion_callback_.Run(); | 333 completion_callback_.Run(); |
| 338 } | 334 } |
| 339 | 335 |
| 340 } // namespace policy | 336 } // namespace policy |
| OLD | NEW |