OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/signin/easy_unlock_service.h" | 5 #include "chrome/browser/signin/easy_unlock_service.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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 weak_ptr_factory_.GetWeakPtr())); | 201 weak_ptr_factory_.GetWeakPtr())); |
202 } | 202 } |
203 | 203 |
204 EasyUnlockService::~EasyUnlockService() { | 204 EasyUnlockService::~EasyUnlockService() { |
205 } | 205 } |
206 | 206 |
207 // static | 207 // static |
208 void EasyUnlockService::RegisterProfilePrefs( | 208 void EasyUnlockService::RegisterProfilePrefs( |
209 user_prefs::PrefRegistrySyncable* registry) { | 209 user_prefs::PrefRegistrySyncable* registry) { |
210 registry->RegisterBooleanPref( | 210 registry->RegisterBooleanPref( |
| 211 prefs::kEasyUnlockAllowed, |
| 212 true, |
| 213 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 214 registry->RegisterBooleanPref( |
211 prefs::kEasyUnlockEnabled, | 215 prefs::kEasyUnlockEnabled, |
212 false, | 216 false, |
213 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 217 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
214 registry->RegisterDictionaryPref( | 218 registry->RegisterDictionaryPref( |
215 prefs::kEasyUnlockPairing, | 219 prefs::kEasyUnlockPairing, |
216 new base::DictionaryValue(), | 220 new base::DictionaryValue(), |
217 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 221 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
218 registry->RegisterBooleanPref( | 222 registry->RegisterBooleanPref( |
219 prefs::kEasyUnlockAllowed, | 223 prefs::kEasyUnlockProximityRequired, |
220 true, | 224 false, |
221 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 225 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
222 } | 226 } |
223 | 227 |
224 // static | 228 // static |
225 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { | 229 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { |
226 registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState); | 230 registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState); |
227 } | 231 } |
228 | 232 |
229 // static | 233 // static |
230 void EasyUnlockService::ResetLocalStateForUser(const std::string& user_id) { | 234 void EasyUnlockService::ResetLocalStateForUser(const std::string& user_id) { |
231 DCHECK(!user_id.empty()); | 235 DCHECK(!user_id.empty()); |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 #endif | 633 #endif |
630 | 634 |
631 void EasyUnlockService::PrepareForSuspend() { | 635 void EasyUnlockService::PrepareForSuspend() { |
632 DisableAppIfLoaded(); | 636 DisableAppIfLoaded(); |
633 if (screenlock_state_handler_ && screenlock_state_handler_->IsActive()) { | 637 if (screenlock_state_handler_ && screenlock_state_handler_->IsActive()) { |
634 UpdateScreenlockState( | 638 UpdateScreenlockState( |
635 EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING); | 639 EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING); |
636 } | 640 } |
637 } | 641 } |
638 | 642 |
OLD | NEW |