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

Unified Diff: components/user_manager/user_manager_base.cc

Issue 2577903002: cros: Fix inconsistent SessionController state for tests (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/session/chrome_session_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/user_manager/user_manager_base.cc
diff --git a/components/user_manager/user_manager_base.cc b/components/user_manager/user_manager_base.cc
index 2c7b3ffddaff6b26cf2afabb450f9794db72702e..37cb8a0ba6856213d4ba53cc89ef7a761d1fb806 100644
--- a/components/user_manager/user_manager_base.cc
+++ b/components/user_manager/user_manager_base.cc
@@ -182,14 +182,18 @@ void UserManagerBase::UserLoggedIn(const AccountId& account_id,
active_user_->set_is_active(true);
active_user_->set_username_hash(username_hash);
- // Place user who just signed in to the top of the logged in users.
- logged_in_users_.insert(logged_in_users_.begin(), active_user_);
+ logged_in_users_.push_back(active_user_);
SetLRUUser(active_user_);
if (!primary_user_) {
primary_user_ = active_user_;
if (primary_user_->HasGaiaAccount())
SendGaiaUserLoginMetrics(account_id);
+ } else if (primary_user_ != active_user_) {
+ // This is only needed for tests where a new user session is created
+ // for non-existent user.
+ SetIsCurrentUserNew(true);
+ NotifyUserAddedToSession(active_user_, true /* user switch pending */);
}
UMA_HISTOGRAM_ENUMERATION(
« no previous file with comments | « chrome/browser/chromeos/login/session/chrome_session_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698