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

Unified Diff: components/proximity_auth/proximity_monitor_impl.h

Issue 1372283002: Hook up ProximityAuthSystem in EasyUnlockService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth_connection
Patch Set: remove log Created 5 years, 3 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/proximity_monitor.h ('k') | components/proximity_auth/proximity_monitor_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/proximity_monitor_impl.h
diff --git a/components/proximity_auth/proximity_monitor_impl.h b/components/proximity_auth/proximity_monitor_impl.h
index 1f0e8a20c6381cc3cf14e54d4924812368a78055..28398830794a6e44295b96d4a2a2bd468a6b5b4c 100644
--- a/components/proximity_auth/proximity_monitor_impl.h
+++ b/components/proximity_auth/proximity_monitor_impl.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "components/proximity_auth/proximity_monitor.h"
#include "components/proximity_auth/remote_device.h"
#include "device/bluetooth/bluetooth_device.h"
@@ -31,8 +32,7 @@ class ProximityMonitorImpl : public ProximityMonitor {
public:
// The |observer| is not owned, and must outlive |this| instance.
ProximityMonitorImpl(const RemoteDevice& remote_device,
- scoped_ptr<base::TickClock> clock,
- ProximityMonitorObserver* observer);
+ scoped_ptr<base::TickClock> clock);
~ProximityMonitorImpl() override;
// ProximityMonitor:
@@ -42,6 +42,8 @@ class ProximityMonitorImpl : public ProximityMonitor {
bool IsUnlockAllowed() const override;
bool IsInRssiRange() const override;
void RecordProximityMetricsOnAuthSuccess() override;
+ void AddObserver(ProximityMonitorObserver* observer) override;
+ void RemoveObserver(ProximityMonitorObserver* observer) override;
protected:
// Sets the proximity detection strategy. Exposed for testing.
@@ -97,13 +99,14 @@ class ProximityMonitorImpl : public ProximityMonitor {
const device::BluetoothDevice::ConnectionInfo& connection_info);
// Checks whether the proximity state has changed based on the current
- // samples. Notifies the |observer_| on a change.
+ // samples. Notifies |observers_| on a change.
void CheckForProximityStateChange();
+ // The remote device being monitored.
const RemoteDevice remote_device_;
- // The |observer_| is not owned, and must outlive |this| instance.
- ProximityMonitorObserver* observer_;
+ // The observers attached to the ProximityMonitor.
+ base::ObserverList<ProximityMonitorObserver> observers_;
// The Bluetooth adapter that will be polled for connection info.
scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_;
« no previous file with comments | « components/proximity_auth/proximity_monitor.h ('k') | components/proximity_auth/proximity_monitor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698