| 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_MONITOR_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_PROXIMITY_MONITOR_H |
| 6 #define COMPONENTS_PROXIMITY_AUTH_PROXIMITY_MONITOR_H | 6 #define COMPONENTS_PROXIMITY_AUTH_PROXIMITY_MONITOR_H |
| 7 | 7 |
| 8 #include "components/proximity_auth/proximity_monitor_observer.h" | |
| 9 | |
| 10 namespace proximity_auth { | 8 namespace proximity_auth { |
| 11 | 9 |
| 12 // An interface that is responsible for tracking whether the remote device is | 10 // An interface that is responsible for tracking whether the remote device is |
| 13 // sufficiently close to the local device to permit unlocking. | 11 // sufficiently close to the local device to permit unlocking. |
| 14 class ProximityMonitor { | 12 class ProximityMonitor { |
| 15 public: | 13 public: |
| 16 enum class Strategy { NONE, CHECK_RSSI, CHECK_TRANSMIT_POWER }; | 14 enum class Strategy { NONE, CHECK_RSSI, CHECK_TRANSMIT_POWER }; |
| 17 | 15 |
| 18 virtual ~ProximityMonitor() {} | 16 virtual ~ProximityMonitor() {} |
| 19 | 17 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 33 // given the user's current settings. | 31 // given the user's current settings. |
| 34 virtual bool IsUnlockAllowed() const = 0; | 32 virtual bool IsUnlockAllowed() const = 0; |
| 35 | 33 |
| 36 // Returns |true| iff the remote device is close enough to the local device, | 34 // Returns |true| iff the remote device is close enough to the local device, |
| 37 // according to its RSSI measurement. | 35 // according to its RSSI measurement. |
| 38 virtual bool IsInRssiRange() const = 0; | 36 virtual bool IsInRssiRange() const = 0; |
| 39 | 37 |
| 40 // Records the current proximity measurements to UMA. This should be called | 38 // Records the current proximity measurements to UMA. This should be called |
| 41 // when the user successfully authenticates using proximity auth. | 39 // when the user successfully authenticates using proximity auth. |
| 42 virtual void RecordProximityMetricsOnAuthSuccess() = 0; | 40 virtual void RecordProximityMetricsOnAuthSuccess() = 0; |
| 43 | |
| 44 // Adds an observer. | |
| 45 virtual void AddObserver(ProximityMonitorObserver* observer) = 0; | |
| 46 | |
| 47 // Removes an observer. | |
| 48 virtual void RemoveObserver(ProximityMonitorObserver* observer) = 0; | |
| 49 }; | 41 }; |
| 50 | 42 |
| 51 } // namespace proximity_auth | 43 } // namespace proximity_auth |
| 52 | 44 |
| 53 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_MONITOR_H | 45 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_MONITOR_H |
| OLD | NEW |