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

Unified Diff: chrome/browser/chromeos/login/users/fake_user_manager.cc

Issue 312023002: Sync starting language and input method preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and dzhioev's comments Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/users/fake_user_manager.cc
diff --git a/chrome/browser/chromeos/login/users/fake_user_manager.cc b/chrome/browser/chromeos/login/users/fake_user_manager.cc
index 56326a68e3e4737b6282625366a6a4b71f78aa7e..77a9670f57182de07db974c5364c8d0b2b1f2140 100644
--- a/chrome/browser/chromeos/login/users/fake_user_manager.cc
+++ b/chrome/browser/chromeos/login/users/fake_user_manager.cc
@@ -116,6 +116,7 @@ void FakeUserManager::UserLoggedIn(const std::string& email,
if ((*it)->username_hash() == username_hash) {
(*it)->set_is_logged_in(true);
logged_in_users_.push_back(*it);
+ SwitchActiveUser((*it)->email());
if (!primary_user_)
primary_user_ = *it;
@@ -149,6 +150,15 @@ user_manager::User* FakeUserManager::GetActiveUser() {
void FakeUserManager::SwitchActiveUser(const std::string& email) {
active_user_id_ = email;
+ if (user_list_.size() && !active_user_id_.empty()) {
+ for (user_manager::UserList::const_iterator it = user_list_.begin();
+ it != user_list_.end(); ++it) {
+ if ((*it)->email() == active_user_id_)
+ (*it)->set_is_active(true);
+ else if ((*it)->is_active())
+ (*it)->set_is_active(false);
+ }
dzhioev (left Google) 2014/08/01 15:30:41 nit: I think '(*it)->set_is_active((*it)->email()
michaelpg 2014/10/20 23:47:27 Done.
+ }
}
void FakeUserManager::SaveUserDisplayName(

Powered by Google App Engine
This is Rietveld 408576698