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

Unified Diff: components/proximity_auth/unlock_manager_impl.cc

Issue 2973243002: Adding pref to store the user-selected proximity threshold. (Closed)
Patch Set: Fixing merge issues Created 3 years, 5 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/unlock_manager_impl.cc
diff --git a/components/proximity_auth/unlock_manager_impl.cc b/components/proximity_auth/unlock_manager_impl.cc
index c2af9d1cd1d8a5ce845ac0a3874a055cc8f5507a..64bb272ecae662810d9c3f9cc0c9060b3a1ee91d 100644
--- a/components/proximity_auth/unlock_manager_impl.cc
+++ b/components/proximity_auth/unlock_manager_impl.cc
@@ -18,6 +18,7 @@
#include "components/proximity_auth/messenger.h"
#include "components/proximity_auth/metrics.h"
#include "components/proximity_auth/proximity_auth_client.h"
+#include "components/proximity_auth/proximity_auth_pref_manager.h"
#include "components/proximity_auth/proximity_monitor_impl.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
@@ -80,12 +81,16 @@ metrics::RemoteSecuritySettingsState GetRemoteSecuritySettingsState(
} // namespace
+class ProximityAuthPrefManager;
+
UnlockManagerImpl::UnlockManagerImpl(
ProximityAuthSystem::ScreenlockType screenlock_type,
- ProximityAuthClient* proximity_auth_client)
+ ProximityAuthClient* proximity_auth_client,
+ ProximityAuthPrefManager* pref_manager)
: screenlock_type_(screenlock_type),
life_cycle_(nullptr),
proximity_auth_client_(proximity_auth_client),
+ pref_manager_(pref_manager),
is_locked_(false),
is_attempting_auth_(false),
is_waking_up_(false),
@@ -158,7 +163,8 @@ void UnlockManagerImpl::OnLifeCycleStateChanged() {
if (state == RemoteDeviceLifeCycle::State::SECURE_CHANNEL_ESTABLISHED) {
DCHECK(life_cycle_->GetConnection());
DCHECK(GetMessenger());
- proximity_monitor_ = CreateProximityMonitor(life_cycle_->GetConnection());
+ proximity_monitor_ =
+ CreateProximityMonitor(life_cycle_->GetConnection(), pref_manager_);
GetMessenger()->AddObserver(this);
}
@@ -323,9 +329,10 @@ void UnlockManagerImpl::OnAuthAttempted(mojom::AuthType auth_type) {
}
std::unique_ptr<ProximityMonitor> UnlockManagerImpl::CreateProximityMonitor(
- cryptauth::Connection* connection) {
+ cryptauth::Connection* connection,
+ ProximityAuthPrefManager* pref_manager) {
return base::MakeUnique<ProximityMonitorImpl>(
- connection, base::WrapUnique(new base::DefaultTickClock()));
+ connection, base::WrapUnique(new base::DefaultTickClock()), pref_manager);
}
void UnlockManagerImpl::SendSignInChallenge() {
« no previous file with comments | « components/proximity_auth/unlock_manager_impl.h ('k') | components/proximity_auth/unlock_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698