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

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 246253009: Multiprofile: switch to newly added user to the session (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed PreferencesTest.MultiProfiles Created 6 years, 8 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/user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index e2c31b1575d38da45bebfc40f4df26df27061e3f..fdff94249134cd6ab2f7f449940b08e91cf63fbb 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -424,9 +424,9 @@ void UserManagerImpl::UserLoggedIn(const std::string& user_id,
lru_logged_in_users_.push_back(user);
// Reset the new user flag if the user already exists.
is_current_user_new_ = false;
- // Set active user wallpaper back.
- WallpaperManager::Get()->SetUserWallpaperNow(active_user_->email());
Nikita (slow) 2014/04/25 15:00:08 So I guess we don't need to switch wallpaper now s
Dmitry Polukhin 2014/04/25 16:07:20 Yes, new user wallpaper is set when his pod activa
NotifyUserAddedToSession(user);
+ // Remember that we need to switch to this user as soon as profile ready.
+ pending_user_switch_ = user_id;
return;
}
@@ -971,7 +971,18 @@ void UserManagerImpl::Observe(int type,
User* user = GetUserByProfile(profile);
if (user != NULL)
user->set_profile_is_created();
-
+ // If there is pending user switch, do it now.
+ if (!pending_user_switch_.empty()) {
+ // Call SwitchActiveUser async because otherwise it may cause
+ // ProfileManager::GetProfile before the profile gets registered
+ // in ProfileManager. It happens in case of sync profile load when
+ // NOTIFICATION_PROFILE_CREATED is called synchronously.
+ base::MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(&UserManagerImpl::SwitchActiveUser,
+ base::Unretained(this),
+ pending_user_switch_));
+ pending_user_switch_.clear();
+ }
break;
}
default:

Powered by Google App Engine
This is Rietveld 408576698