Chromium Code Reviews| 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..15fe052783253b99650f056bc028161f790fc0f9 100644 |
| --- a/components/proximity_auth/proximity_auth_system.cc |
| +++ b/components/proximity_auth/proximity_auth_system.cc |
| @@ -44,11 +44,12 @@ 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) { |
| +void ProximityAuthSystem::OnAuthAttempted(const AccountId& account_id) { |
|
achuithb
2015/12/04 10:12:53
/* account_id */
Alexander Alekseev
2015/12/04 12:44:07
Done.
|
| // TODO(tengs): There is no reason to pass the |user_id| argument anymore. |
|
achuithb
2015/12/04 10:12:53
update comment
Alexander Alekseev
2015/12/04 12:44:07
Done.
|
| 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(); |