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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2872133009: ChromeOS: Fix DCHECK hit when logging under Guest (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 for (it = sessions.begin(); it != sessions.end(); ++it) { 1509 for (it = sessions.begin(); it != sessions.end(); ++it) {
1510 if (active_cryptohome_id == it->first) 1510 if (active_cryptohome_id == it->first)
1511 continue; 1511 continue;
1512 pending_user_sessions_[(it->first).GetAccountId()] = it->second; 1512 pending_user_sessions_[(it->first).GetAccountId()] = it->second;
1513 } 1513 }
1514 RestorePendingUserSessions(); 1514 RestorePendingUserSessions();
1515 } 1515 }
1516 1516
1517 void UserSessionManager::RestorePendingUserSessions() { 1517 void UserSessionManager::RestorePendingUserSessions() {
1518 if (pending_user_sessions_.empty()) { 1518 if (pending_user_sessions_.empty()) {
1519 user_manager::UserManager::Get()->SwitchToLastActiveUser(); 1519 // '>1' ignores "restart on signin" because of browser flags difference.
1520 // In this case, last_session_active_account_id_ can carry account_id
1521 // from the previous browser session.
1522 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() > 1)
1523 user_manager::UserManager::Get()->SwitchToLastActiveUser();
1524
1520 NotifyPendingUserSessionsRestoreFinished(); 1525 NotifyPendingUserSessionsRestoreFinished();
1521 return; 1526 return;
1522 } 1527 }
1523 1528
1524 // Get next user to restore sessions and delete it from list. 1529 // Get next user to restore sessions and delete it from list.
1525 PendingUserSessions::const_iterator it = pending_user_sessions_.begin(); 1530 PendingUserSessions::const_iterator it = pending_user_sessions_.begin();
1526 const AccountId account_id = it->first; 1531 const AccountId account_id = it->first;
1527 std::string user_id_hash = it->second; 1532 std::string user_id_hash = it->second;
1528 DCHECK(account_id.is_valid()); 1533 DCHECK(account_id.is_valid());
1529 DCHECK(!user_id_hash.empty()); 1534 DCHECK(!user_id_hash.empty());
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 ->browser_policy_connector_chromeos() 1939 ->browser_policy_connector_chromeos()
1935 ->IsEnterpriseManaged()) { 1940 ->IsEnterpriseManaged()) {
1936 return false; 1941 return false;
1937 } 1942 }
1938 1943
1939 // Do not show end of life notification if this is a guest session 1944 // Do not show end of life notification if this is a guest session
1940 return !profile->IsGuestSession(); 1945 return !profile->IsGuestSession();
1941 } 1946 }
1942 1947
1943 } // namespace chromeos 1948 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698