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 4b70d6865451dcb677745dc0e52c73833033c9bb..52be76966c2e4a8a7bce4b2fa137e96211b6cba8 100644 |
| --- a/components/proximity_auth/proximity_auth_system.cc |
| +++ b/components/proximity_auth/proximity_auth_system.cc |
| @@ -127,17 +127,18 @@ void ProximityAuthSystem::OnScreenDidUnlock( |
| } |
| void ProximityAuthSystem::OnFocusedUserChanged(const AccountId& account_id) { |
| - if (!account_id.is_valid()) |
| - return; |
| - |
| // Update the current RemoteDeviceLifeCycle to the focused user. |
| - if (remote_device_life_cycle_ && |
| - remote_device_life_cycle_->GetRemoteDevice().user_id != |
| - account_id.GetUserEmail()) { |
| - PA_LOG(INFO) << "Focused user changed, destroying life cycle for " |
| - << account_id.Serialize() << "."; |
| - unlock_manager_->SetRemoteDeviceLifeCycle(nullptr); |
| - remote_device_life_cycle_.reset(); |
| + if (remote_device_life_cycle_) { |
| + if (remote_device_life_cycle_->GetRemoteDevice().user_id != |
| + account_id.GetUserEmail()) { |
| + PA_LOG(INFO) << "Focused user changed, destroying life cycle for " |
| + << account_id.Serialize() << "."; |
| + unlock_manager_->SetRemoteDeviceLifeCycle(nullptr); |
| + remote_device_life_cycle_.reset(); |
| + } else { |
| + PA_LOG(INFO) << "User " << account_id.Serialize() << " already focused."; |
|
Ryan Hansberry
2017/05/09 02:51:43
nit: describe more what happened, e.g. "Refocused
Tim Song
2017/05/10 18:11:16
Done.
|
| + return; |
| + } |
| } |
| if (remote_devices_map_.find(account_id) == remote_devices_map_.end() || |