Commit 67cd35ce authored by alemate's avatar alemate Committed by Commit bot

ChromeOS: Fix DCHECK hit when logging under Guest

We should not SwitchToLastActiveUser() when there is only one user logged in.
This covers restart on signin, when last_active_user may be outdated.

BUG=714250

Review-Url: https://codereview.chromium.org/2872133009
Cr-Commit-Position: refs/heads/master@{#471127}
parent 2e6f9e37
...@@ -1516,7 +1516,12 @@ void UserSessionManager::OnRestoreActiveSessions( ...@@ -1516,7 +1516,12 @@ void UserSessionManager::OnRestoreActiveSessions(
void UserSessionManager::RestorePendingUserSessions() { void UserSessionManager::RestorePendingUserSessions() {
if (pending_user_sessions_.empty()) { if (pending_user_sessions_.empty()) {
user_manager::UserManager::Get()->SwitchToLastActiveUser(); // '>1' ignores "restart on signin" because of browser flags difference.
// In this case, last_session_active_account_id_ can carry account_id
// from the previous browser session.
if (user_manager::UserManager::Get()->GetLoggedInUsers().size() > 1)
user_manager::UserManager::Get()->SwitchToLastActiveUser();
NotifyPendingUserSessionsRestoreFinished(); NotifyPendingUserSessionsRestoreFinished();
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment