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

Unified Diff: components/proximity_auth/proximity_auth_system.cc

Issue 1494153002: This CL replaces e-mail with AccountId in easy signin code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 5 years 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/proximity_auth_system.cc
diff --git a/components/proximity_auth/proximity_auth_system.cc b/components/proximity_auth/proximity_auth_system.cc
index 2a30b472e9263a2b95d27c400bd977e798ae240b..c95eae138a2e98ad0e6706fbd1b47e26707b7f0e 100644
--- a/components/proximity_auth/proximity_auth_system.cc
+++ b/components/proximity_auth/proximity_auth_system.cc
@@ -44,12 +44,13 @@ ProximityAuthSystem::~ProximityAuthSystem() {
void ProximityAuthSystem::Start() {
ScreenlockBridge::Get()->AddObserver(this);
- if (remote_device_.user_id == ScreenlockBridge::Get()->focused_user_id())
- OnFocusedUserChanged(ScreenlockBridge::Get()->focused_user_id());
+ if (remote_device_.user_id ==
+ ScreenlockBridge::Get()->focused_account_id().GetUserEmail())
+ OnFocusedUserChanged(ScreenlockBridge::Get()->focused_account_id());
}
-void ProximityAuthSystem::OnAuthAttempted(const std::string& user_id) {
- // TODO(tengs): There is no reason to pass the |user_id| argument anymore.
+void ProximityAuthSystem::OnAuthAttempted(const AccountId& /* account_id */) {
+ // TODO(tengs): There is no reason to pass the |account_id| argument anymore.
unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK);
}
@@ -82,7 +83,7 @@ void ProximityAuthSystem::ResumeAfterWakeUpTimeout() {
PA_LOG(INFO) << "Resume after suspend";
suspended_ = false;
if (ScreenlockBridge::Get()->IsLocked())
- OnFocusedUserChanged(ScreenlockBridge::Get()->focused_user_id());
+ OnFocusedUserChanged(ScreenlockBridge::Get()->focused_account_id());
}
void ProximityAuthSystem::OnLifeCycleStateChanged(
@@ -93,7 +94,7 @@ void ProximityAuthSystem::OnLifeCycleStateChanged(
void ProximityAuthSystem::OnScreenDidLock(
ScreenlockBridge::LockHandler::ScreenType screen_type) {
- OnFocusedUserChanged(ScreenlockBridge::Get()->focused_user_id());
+ OnFocusedUserChanged(ScreenlockBridge::Get()->focused_account_id());
}
void ProximityAuthSystem::OnScreenDidUnlock(
@@ -102,8 +103,9 @@ void ProximityAuthSystem::OnScreenDidUnlock(
remote_device_life_cycle_.reset();
}
-void ProximityAuthSystem::OnFocusedUserChanged(const std::string& user_id) {
- if (!user_id.empty() && remote_device_.user_id != user_id) {
+void ProximityAuthSystem::OnFocusedUserChanged(const AccountId& account_id) {
+ if (account_id.is_valid() &&
+ remote_device_.user_id != account_id.GetUserEmail()) {
PA_LOG(INFO) << "Different user focused, destroying RemoteDeviceLifeCycle.";
unlock_manager_->SetRemoteDeviceLifeCycle(nullptr);
remote_device_life_cycle_.reset();

Powered by Google App Engine
This is Rietveld 408576698