| Index: components/proximity_auth/proximity_auth_pref_manager.cc
|
| diff --git a/components/proximity_auth/proximity_auth_pref_manager.cc b/components/proximity_auth/proximity_auth_pref_manager.cc
|
| index c8c637c0cf2b8869ce7a8c40e334d6f952b7801a..39101cbeae5c875ec8e9f06f723d9768d76fe419 100644
|
| --- a/components/proximity_auth/proximity_auth_pref_manager.cc
|
| +++ b/components/proximity_auth/proximity_auth_pref_manager.cc
|
| @@ -9,7 +9,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/values.h"
|
| -#include "components/prefs/pref_registry_simple.h"
|
| +#include "components/pref_registry/pref_registry_syncable.h"
|
| #include "components/prefs/pref_service.h"
|
| #include "components/prefs/scoped_user_pref_update.h"
|
| #include "components/proximity_auth/logging/logging.h"
|
| @@ -23,10 +23,14 @@ ProximityAuthPrefManager::ProximityAuthPrefManager(PrefService* pref_service)
|
| ProximityAuthPrefManager::~ProximityAuthPrefManager() {}
|
|
|
| // static
|
| -void ProximityAuthPrefManager::RegisterPrefs(PrefRegistrySimple* registry) {
|
| +void ProximityAuthPrefManager::RegisterPrefs(
|
| + user_prefs::PrefRegistrySyncable* registry) {
|
| registry->RegisterInt64Pref(prefs::kProximityAuthLastPasswordEntryTimestampMs,
|
| 0L);
|
| registry->RegisterDictionaryPref(prefs::kProximityAuthRemoteBleDevices);
|
| + registry->RegisterIntegerPref(
|
| + prefs::kEasyUnlockProximityThreshold, 1,
|
| + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
| }
|
|
|
| bool ProximityAuthPrefManager::HasDeviceWithAddress(
|
| @@ -121,4 +125,15 @@ const base::DictionaryValue* ProximityAuthPrefManager::GetRemoteBleDevices()
|
| return pref_service_->GetDictionary(prefs::kProximityAuthRemoteBleDevices);
|
| }
|
|
|
| +void ProximityAuthPrefManager::SetProximityThreshold(ProximityThreshold value) {
|
| + pref_service_->SetInteger(prefs::kEasyUnlockProximityThreshold, value);
|
| +}
|
| +
|
| +ProximityAuthPrefManager::ProximityThreshold
|
| +ProximityAuthPrefManager::GetProximityThreshold() const {
|
| + int pref_value =
|
| + pref_service_->GetInteger(prefs::kEasyUnlockProximityThreshold);
|
| + return static_cast<ProximityThreshold>(pref_value);
|
| +}
|
| +
|
| } // namespace proximity_auth
|
|
|