| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Queries the devices stored in |kProximityAuthRemoteBleDevices| pref by | 53 // Queries the devices stored in |kProximityAuthRemoteBleDevices| pref by |
| 54 // |bluetooth_address| or |public_key|. Virtual for testing. | 54 // |bluetooth_address| or |public_key|. Virtual for testing. |
| 55 virtual bool HasDeviceWithAddress(const std::string& bluetooth_address) const; | 55 virtual bool HasDeviceWithAddress(const std::string& bluetooth_address) const; |
| 56 virtual bool HasDeviceWithPublicKey(const std::string& public_key) const; | 56 virtual bool HasDeviceWithPublicKey(const std::string& public_key) const; |
| 57 virtual std::string GetDevicePublicKey( | 57 virtual std::string GetDevicePublicKey( |
| 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 |
| 63 // preference is used to enforce reauthing with the password after a given |
| 64 // time period has elapsed. |
| 65 void SetLastPasswordEntryTimestampMs(int64_t timestamp_ms); |
| 66 int64_t GetLastPasswordEntryTimestampMs(); |
| 67 |
| 62 private: | 68 private: |
| 63 const base::DictionaryValue* GetRemoteBleDevices() const; | 69 const base::DictionaryValue* GetRemoteBleDevices() const; |
| 64 | 70 |
| 65 // Contains perferences that outlive the lifetime of this object and across | 71 // Contains perferences that outlive the lifetime of this object and across |
| 66 // process restarts. Not owned and must outlive this instance. | 72 // process restarts. Not owned and must outlive this instance. |
| 67 PrefService* pref_service_; | 73 PrefService* pref_service_; |
| 68 | 74 |
| 69 DISALLOW_COPY_AND_ASSIGN(ProximityAuthPrefManager); | 75 DISALLOW_COPY_AND_ASSIGN(ProximityAuthPrefManager); |
| 70 }; | 76 }; |
| 71 | 77 |
| 72 } // namespace proximity_auth | 78 } // namespace proximity_auth |
| 73 | 79 |
| 74 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H | 80 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H |
| OLD | NEW |