| 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 "apps/app_lifetime_monitor.h" | 7 #include "apps/app_lifetime_monitor.h" |
| 8 #include "apps/app_lifetime_monitor_factory.h" | 8 #include "apps/app_lifetime_monitor_factory.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 tpm_key_checked_(false), | 254 tpm_key_checked_(false), |
| 255 weak_ptr_factory_(this) { | 255 weak_ptr_factory_(this) { |
| 256 } | 256 } |
| 257 | 257 |
| 258 EasyUnlockService::~EasyUnlockService() { | 258 EasyUnlockService::~EasyUnlockService() { |
| 259 } | 259 } |
| 260 | 260 |
| 261 // static | 261 // static |
| 262 void EasyUnlockService::RegisterProfilePrefs( | 262 void EasyUnlockService::RegisterProfilePrefs( |
| 263 user_prefs::PrefRegistrySyncable* registry) { | 263 user_prefs::PrefRegistrySyncable* registry) { |
| 264 registry->RegisterBooleanPref( | 264 registry->RegisterBooleanPref(prefs::kEasyUnlockAllowed, true); |
| 265 prefs::kEasyUnlockAllowed, | 265 registry->RegisterBooleanPref(prefs::kEasyUnlockEnabled, false); |
| 266 true, | 266 registry->RegisterDictionaryPref(prefs::kEasyUnlockPairing, |
| 267 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 267 new base::DictionaryValue()); |
| 268 registry->RegisterBooleanPref( | |
| 269 prefs::kEasyUnlockEnabled, | |
| 270 false, | |
| 271 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 272 registry->RegisterDictionaryPref( | |
| 273 prefs::kEasyUnlockPairing, | |
| 274 new base::DictionaryValue(), | |
| 275 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 276 registry->RegisterBooleanPref( | 268 registry->RegisterBooleanPref( |
| 277 prefs::kEasyUnlockProximityRequired, | 269 prefs::kEasyUnlockProximityRequired, |
| 278 false, | 270 false, |
| 279 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 271 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 280 } | 272 } |
| 281 | 273 |
| 282 // static | 274 // static |
| 283 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { | 275 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { |
| 284 registry->RegisterStringPref(prefs::kEasyUnlockDeviceId, std::string()); | 276 registry->RegisterStringPref(prefs::kEasyUnlockDeviceId, std::string()); |
| 285 registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState); | 277 registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState); |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 | 860 |
| 869 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 861 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 870 // failed. | 862 // failed. |
| 871 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 863 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 872 ->PrepareTpmKey(true /* check_private_key */, | 864 ->PrepareTpmKey(true /* check_private_key */, |
| 873 base::Closure()); | 865 base::Closure()); |
| 874 #endif // defined(OS_CHROMEOS) | 866 #endif // defined(OS_CHROMEOS) |
| 875 | 867 |
| 876 tpm_key_checked_ = true; | 868 tpm_key_checked_ = true; |
| 877 } | 869 } |
| OLD | NEW |