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

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

Issue 585653002: After locking a profile and showing the User Manager, make Guest the active profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments + rebase Created 6 years, 3 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 678881e97fcbf30abee36a797177205bc3292739..175ddc14e03cf4abde7f4c99f41caed0e9899a27 100644
--- a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
+++ b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
@@ -4,9 +4,12 @@
#include "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
+#include "base/mac/foundation_util.h"
#include "chrome/app/chrome_command_ids.h"
+#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/ui/browser_dialogs.h"
#import "chrome/browser/ui/cocoa/browser_window_utils.h"
#include "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
@@ -146,6 +149,16 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate {
}
- (void)show {
+ // Because the User Manager isn't a BrowserWindowController, activating it
+ // 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];
+ }
[[self window] makeKeyAndOrderFront:self];
}

Powered by Google App Engine
This is Rietveld 408576698