Chromium Code Reviews| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "apps/app_lifetime_monitor.h" | 9 #include "apps/app_lifetime_monitor.h" |
| 10 #include "apps/app_lifetime_monitor_factory.h" | 10 #include "apps/app_lifetime_monitor_factory.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 void EasyUnlockService::RegisterProfilePrefs( | 256 void EasyUnlockService::RegisterProfilePrefs( |
| 257 user_prefs::PrefRegistrySyncable* registry) { | 257 user_prefs::PrefRegistrySyncable* registry) { |
| 258 registry->RegisterBooleanPref(prefs::kEasyUnlockAllowed, true); | 258 registry->RegisterBooleanPref(prefs::kEasyUnlockAllowed, true); |
| 259 registry->RegisterBooleanPref(prefs::kEasyUnlockEnabled, false); | 259 registry->RegisterBooleanPref(prefs::kEasyUnlockEnabled, false); |
| 260 registry->RegisterDictionaryPref(prefs::kEasyUnlockPairing, | 260 registry->RegisterDictionaryPref(prefs::kEasyUnlockPairing, |
| 261 base::MakeUnique<base::DictionaryValue>()); | 261 base::MakeUnique<base::DictionaryValue>()); |
| 262 registry->RegisterBooleanPref( | 262 registry->RegisterBooleanPref( |
| 263 prefs::kEasyUnlockProximityRequired, | 263 prefs::kEasyUnlockProximityRequired, |
| 264 false, | 264 false, |
| 265 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 265 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 266 registry->RegisterIntegerPref( | |
|
Tim Song
2017/07/07 21:48:24
Note: We also need to sync this to the local state
Tim Song
2017/07/07 21:48:24
Although there are a lot of prefs here, I want to
sacomoto
2017/07/10 16:54:07
I moved it to ProximityAuthPrefManager. There is a
sacomoto
2017/07/10 16:54:07
Done.
| |
| 267 prefs::kEasyUnlockProximityThreshold, 1, | |
| 268 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 266 | 269 |
| 267 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 270 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 268 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)) | 271 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)) |
| 269 proximity_auth::ProximityAuthPrefManager::RegisterPrefs(registry); | 272 proximity_auth::ProximityAuthPrefManager::RegisterPrefs(registry); |
| 270 } | 273 } |
| 271 | 274 |
| 272 // static | 275 // static |
| 273 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { | 276 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { |
| 274 registry->RegisterStringPref(prefs::kEasyUnlockDeviceId, std::string()); | 277 registry->RegisterStringPref(prefs::kEasyUnlockDeviceId, std::string()); |
| 275 registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState); | 278 registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState); |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 913 | 916 |
| 914 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 917 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 915 // failed. | 918 // failed. |
| 916 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 919 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 917 ->PrepareTpmKey(true /* check_private_key */, | 920 ->PrepareTpmKey(true /* check_private_key */, |
| 918 base::Closure()); | 921 base::Closure()); |
| 919 #endif // defined(OS_CHROMEOS) | 922 #endif // defined(OS_CHROMEOS) |
| 920 | 923 |
| 921 tpm_key_checked_ = true; | 924 tpm_key_checked_ = true; |
| 922 } | 925 } |
| OLD | NEW |