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

Unified Diff: components/proximity_auth/proximity_auth_pref_manager.h

Issue 2973243002: Adding pref to store the user-selected proximity threshold. (Closed)
Patch Set: Fixing merge issues 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
« no previous file with comments | « components/proximity_auth/DEPS ('k') | components/proximity_auth/proximity_auth_pref_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/proximity_auth_pref_manager.h
diff --git a/components/proximity_auth/proximity_auth_pref_manager.h b/components/proximity_auth/proximity_auth_pref_manager.h
index 9f74191417fc2f6efe8823ad2e81f4e26085ead1..9d945e19f1aaa7a184888137f2c6abc7e563a17a 100644
--- a/components/proximity_auth/proximity_auth_pref_manager.h
+++ b/components/proximity_auth/proximity_auth_pref_manager.h
@@ -11,13 +11,16 @@
#include "base/macros.h"
-class PrefRegistrySimple;
class PrefService;
namespace base {
class DictionaryValue;
} // namespace base
+namespace user_prefs {
+class PrefRegistrySyncable;
+} // namespace user_prefs
+
namespace proximity_auth {
// This class manages the local (persistent) settings used by Smart Lock. It
@@ -33,7 +36,7 @@ class ProximityAuthPrefManager {
virtual ~ProximityAuthPrefManager();
// Registers the prefs used by this class to the given |pref_service|.
- static void RegisterPrefs(PrefRegistrySimple* registry);
+ static void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry);
// Methods used to handle remote BLE devices stored in prefs
// (kProximityAuthRemoteBleDevices).
@@ -65,6 +68,22 @@ class ProximityAuthPrefManager {
virtual void SetLastPasswordEntryTimestampMs(int64_t timestamp_ms);
virtual int64_t GetLastPasswordEntryTimestampMs() const;
+ // These are arbitrary labels displayed in the settings page for the user
+ // to select. The actual mapping is done in the ProximityMonitorImpl.
+ enum ProximityThreshold {
+ kVeryClose = 0,
+ kClose = 1,
+ kFar = 2,
+ kVeryFar = 3
+ };
+
+ // Setter and getter for the proximity threshold. This preference is
+ // exposed to the user, allowing him / her to change how close the
+ // phone must for the unlock to be allowed.
+ // Note: These are arbitrary values,
+ virtual void SetProximityThreshold(ProximityThreshold value);
+ virtual ProximityThreshold GetProximityThreshold() const;
+
private:
const base::DictionaryValue* GetRemoteBleDevices() const;
« no previous file with comments | « components/proximity_auth/DEPS ('k') | components/proximity_auth/proximity_auth_pref_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698