Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: components/proximity_auth/proximity_auth_pref_manager.cc

Issue 2973243002: Adding pref to store the user-selected proximity threshold. (Closed)
Patch Set: Fixing tests Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f5c21ac3bf1f6af14881ee0bc29a3d9025f8b189 100644
--- a/components/proximity_auth/proximity_auth_pref_manager.cc
+++ b/components/proximity_auth/proximity_auth_pref_manager.cc
@@ -9,6 +9,8 @@
#include "base/macros.h"
#include "base/values.h"
+#include "chrome/common/pref_names.h"
+#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
@@ -27,6 +29,9 @@ void ProximityAuthPrefManager::RegisterPrefs(PrefRegistrySimple* 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 +126,12 @@ const base::DictionaryValue* ProximityAuthPrefManager::GetRemoteBleDevices()
return pref_service_->GetDictionary(prefs::kProximityAuthRemoteBleDevices);
}
+void ProximityAuthPrefManager::SetProximityThreshold(int value) {
+ pref_service_->SetInteger(::prefs::kEasyUnlockProximityThreshold, value);
+}
+
+int ProximityAuthPrefManager::GetProximityThreshold() const {
+ return pref_service_->GetInteger(::prefs::kEasyUnlockProximityThreshold);
+}
+
} // namespace proximity_auth

Powered by Google App Engine
This is Rietveld 408576698