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

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

Issue 1209193003: [Proximity Auth] Create one ProximityAuthClient per profile, rather than one global one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable tests on non-ChromeOS, since there's nothing left to test on the other platforms Created 5 years, 6 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.cc
diff --git a/components/proximity_auth/ble/proximity_auth_ble_system.cc b/components/proximity_auth/ble/proximity_auth_ble_system.cc
index cfd2074be0c97b3e7a7600ac937f9468afe3ea4e..1a399b4a8366ab2aba8d208445555269b7940d4b 100644
--- a/components/proximity_auth/ble/proximity_auth_ble_system.cc
+++ b/components/proximity_auth/ble/proximity_auth_ble_system.cc
@@ -16,6 +16,7 @@
#include "components/proximity_auth/cryptauth/cryptauth_client.h"
#include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h"
#include "components/proximity_auth/logging/logging.h"
+#include "components/proximity_auth/proximity_auth_client.h"
#include "components/proximity_auth/remote_device.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_gatt_connection.h"
@@ -70,17 +71,17 @@ void ProximityAuthBleSystem::ScreenlockBridgeAdapter::RemoveObserver(
}
void ProximityAuthBleSystem::ScreenlockBridgeAdapter::Unlock(
- content::BrowserContext* browser_context) {
- screenlock_bridge_->Unlock(browser_context);
+ ProximityAuthClient* client) {
+ screenlock_bridge_->Unlock(client->GetAuthenticatedUsername());
}
ProximityAuthBleSystem::ProximityAuthBleSystem(
ScreenlockBridge* screenlock_bridge,
- content::BrowserContext* browser_context,
+ ProximityAuthClient* proximity_auth_client,
scoped_ptr<CryptAuthClientFactory> cryptauth_client_factory)
: screenlock_bridge_(new ProximityAuthBleSystem::ScreenlockBridgeAdapter(
screenlock_bridge)),
- browser_context_(browser_context),
+ proximity_auth_client_(proximity_auth_client),
cryptauth_client_factory_(cryptauth_client_factory.Pass()),
is_polling_screen_state_(false),
weak_ptr_factory_(this) {
@@ -89,10 +90,10 @@ ProximityAuthBleSystem::ProximityAuthBleSystem(
}
ProximityAuthBleSystem::ProximityAuthBleSystem(
- ScreenlockBridgeAdapter* screenlock_bridge,
- content::BrowserContext* browser_context)
- : screenlock_bridge_(screenlock_bridge),
- browser_context_(browser_context),
+ scoped_ptr<ScreenlockBridgeAdapter> screenlock_bridge,
+ ProximityAuthClient* proximity_auth_client)
+ : screenlock_bridge_(screenlock_bridge.Pass()),
+ proximity_auth_client_(proximity_auth_client),
is_polling_screen_state_(false),
weak_ptr_factory_(this) {
PA_LOG(INFO) << "Starting Proximity Auth over Bluetooth Low Energy.";
@@ -210,7 +211,7 @@ void ProximityAuthBleSystem::OnMessageReceived(const Connection& connection,
// the Proximity Auth Unlock Manager migration to C++ is done.
if (message.payload() == kScreenUnlocked) {
PA_LOG(INFO) << "Device unlocked. Unlock.";
- screenlock_bridge_->Unlock(browser_context_);
+ screenlock_bridge_->Unlock(proximity_auth_client_);
}
}

Powered by Google App Engine
This is Rietveld 408576698