OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |