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

Unified Diff: chrome/browser/ui/cocoa/profiles/user_manager_mac.mm

Issue 885493005: Setting Guest last-active for the User Manager doesn't create the Guest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac UserManager asyncly creates Guest for Controller Created 5 years, 11 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/ui/cocoa/profiles/user_manager_mac.mm
diff --git a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
index 89fd112b6e3f02c0fede01052ce0d13e800c1569..24413edeb490c6fb83ee1d7ac09e8a4325f9c6ed 100644
--- a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
+++ b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
@@ -23,6 +23,18 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/events/keycodes/keyboard_codes.h"
+namespace {
+
+void ChangeAppControllerForProfile(Profile* profile,
Alexei Svitkine (slow) 2015/01/28 21:12:32 Add a comment.
Mike Lerman 2015/01/29 14:01:58 Done.
+ Profile::CreateStatus status) {
+ if (status == Profile::CREATE_STATUS_INITIALIZED) {
+ AppController* controller =
+ base::mac::ObjCCast<AppController>([NSApp delegate]);
+ [controller windowChangedToProfile:profile];
+ }
+}
+
+}
Alexei Svitkine (slow) 2015/01/28 21:12:32 Add " // namespace" comment.
Mike Lerman 2015/01/29 14:01:58 Done.
// An open User Manager window. There can only be one open at a time. This
// is reset to NULL when the window is closed.
@@ -141,11 +153,13 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate {
// will not trigger a -windowChangedToProfile and update the menu bar.
// This is only important if the active profile is Guest, which may have
// happened after locking a profile.
- Profile* guestProfile = profiles::SetActiveProfileToGuestIfLocked();
- if (guestProfile && guestProfile->IsGuestSession()) {
- AppController* controller =
- base::mac::ObjCCast<AppController>([NSApp delegate]);
- [controller windowChangedToProfile:guestProfile];
+ if (profiles::SetActiveProfileToGuestIfLocked()) {
+ g_browser_process->profile_manager()->CreateProfileAsync(
+ ProfileManager::GetGuestProfilePath(),
+ base::Bind(&ChangeAppControllerForProfile),
+ base::string16(),
+ base::string16(),
+ std::string());
}
[[self window] makeKeyAndOrderFront:self];
}
« chrome/browser/profiles/profiles_state.cc ('K') | « chrome/browser/profiles/profiles_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698