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

Unified Diff: components/proximity_auth/ble/proximity_auth_ble_system.h

Issue 1102473003: Unlock Chrome when a phone with Smart Lock service is found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_screen_lock
Patch Set: Nits Created 5 years, 8 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
Index: components/proximity_auth/ble/proximity_auth_ble_system.h
diff --git a/components/proximity_auth/ble/proximity_auth_ble_system.h b/components/proximity_auth/ble/proximity_auth_ble_system.h
index 29ba6623f1085ad8d1a89f2ef4693795b3f12154..607f4ce2c7e42d50b901631cf5cc0663fc229db7 100644
--- a/components/proximity_auth/ble/proximity_auth_ble_system.h
+++ b/components/proximity_auth/ble/proximity_auth_ble_system.h
@@ -7,23 +7,50 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "components/proximity_auth/screenlock_bridge.h"
-#include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h"
+namespace content {
+class BrowserContext;
+}
+
+namespace device {
+class BluetoothGattConnection;
+}
namespace proximity_auth {
+class BluetoothLowEnergyConnectionFinder;
+
// This is the main entry point to start Proximity Auth over Bluetooth Low
// Energy. This is the underlying system for the Smart Lock features. It will
// discover Bluetooth Low Energy phones and unlock the lock screen if the phone
// passes an authorization and authentication protocol.
-class ProximityAuthBleSystem {
+class ProximityAuthBleSystem : public ScreenlockBridge::Observer {
public:
- ProximityAuthBleSystem();
- ~ProximityAuthBleSystem();
+ ProximityAuthBleSystem(ScreenlockBridge* screenlock_bridge,
+ content::BrowserContext* browser_context);
+ ~ProximityAuthBleSystem() override;
+
+ // ScreenlockBridge::Observer:
+ void OnScreenDidLock(
+ ScreenlockBridge::LockHandler::ScreenType screen_type) override;
+ void OnScreenDidUnlock(
+ ScreenlockBridge::LockHandler::ScreenType screen_type) override;
+ void OnFocusedUserChanged(const std::string& user_id) override;
private:
+ // Handler for a new connection found event.
+ void OnConnectionFound(
+ scoped_ptr<device::BluetoothGattConnection> connection);
+
+ ScreenlockBridge* screenlock_bridge_; // Not owned. Must outlive this object.
+ content::BrowserContext*
+ browser_context_; // Not owned. Must outlive this object.
+
scoped_ptr<BluetoothLowEnergyConnectionFinder> connection_finder_;
+ base::WeakPtrFactory<ProximityAuthBleSystem> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ProximityAuthBleSystem);
};

Powered by Google App Engine
This is Rietveld 408576698