OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H |
6 #define COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H | 6 #define COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const std::string& bluetooth_address) const; | 58 const std::string& bluetooth_address) const; |
59 virtual std::string GetDeviceAddress(const std::string& public_key) const; | 59 virtual std::string GetDeviceAddress(const std::string& public_key) const; |
60 virtual std::vector<std::string> GetPublicKeys() const; | 60 virtual std::vector<std::string> GetPublicKeys() const; |
61 | 61 |
62 // Setter and getter for the timestamp of the last password entry. This | 62 // Setter and getter for the timestamp of the last password entry. This |
63 // preference is used to enforce reauthing with the password after a given | 63 // preference is used to enforce reauthing with the password after a given |
64 // time period has elapsed. | 64 // time period has elapsed. |
65 virtual void SetLastPasswordEntryTimestampMs(int64_t timestamp_ms); | 65 virtual void SetLastPasswordEntryTimestampMs(int64_t timestamp_ms); |
66 virtual int64_t GetLastPasswordEntryTimestampMs() const; | 66 virtual int64_t GetLastPasswordEntryTimestampMs() const; |
67 | 67 |
| 68 // These are arbitrary labels displayed in the settings page for the user |
| 69 // to select. The actual mapping is done in the ProximityMonitorImpl. |
| 70 enum ProximityThreshold { |
| 71 kVeryClose = 0, |
| 72 kClose = 1, |
| 73 kFar = 2, |
| 74 kVeryFar = 3 |
| 75 }; |
| 76 |
| 77 // Setter and getter for the proximity threshold. This preference is |
| 78 // exposed to the user, allowing him / her to change how close the |
| 79 // phone must for the unlock to be allowed. |
| 80 // Note: These are arbitrary values, |
| 81 virtual void SetProximityThreshold(ProximityThreshold value); |
| 82 virtual ProximityThreshold GetProximityThreshold() const; |
| 83 |
68 private: | 84 private: |
69 const base::DictionaryValue* GetRemoteBleDevices() const; | 85 const base::DictionaryValue* GetRemoteBleDevices() const; |
70 | 86 |
71 // Contains perferences that outlive the lifetime of this object and across | 87 // Contains perferences that outlive the lifetime of this object and across |
72 // process restarts. Not owned and must outlive this instance. | 88 // process restarts. Not owned and must outlive this instance. |
73 PrefService* pref_service_; | 89 PrefService* pref_service_; |
74 | 90 |
75 DISALLOW_COPY_AND_ASSIGN(ProximityAuthPrefManager); | 91 DISALLOW_COPY_AND_ASSIGN(ProximityAuthPrefManager); |
76 }; | 92 }; |
77 | 93 |
78 } // namespace proximity_auth | 94 } // namespace proximity_auth |
79 | 95 |
80 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H | 96 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H |
OLD | NEW |