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

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

Issue 2034093003: Added flags for previous code change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More unittest fix Created 4 years, 6 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/profile_chooser_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
index 8ea08924a5172da145340bc3b2d327a16a565b5b..20da1a19f1671d29ae789978355199e124d4ce85 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
@@ -1034,6 +1034,13 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
profiles::CloseGuestProfileWindows();
}
+- (IBAction)goIncognito:(id)sender {
+ DCHECK([self shouldShowGoIncognito]);
+ chrome::NewIncognitoWindow(browser_);
+ [self postActionPerformed:
+ ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO];
+}
+
- (IBAction)showAccountManagement:(id)sender {
[self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT];
}
@@ -1961,9 +1968,27 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
viewRect.origin.y = NSMaxY([separator frame]);
}
+ if (!switches::IsMaterialDesignUserMenu() && [self shouldShowGoIncognito]) {
+ NSButton* goIncognitoButton =
+ [self hoverButtonWithRect:viewRect
+ text:l10n_util::GetNSString(
+ IDS_PROFILES_GO_INCOGNITO_BUTTON)
+ imageResourceId:IDR_ICON_PROFILES_MENU_INCOGNITO
+ action:@selector(goIncognito:)];
+ viewRect.origin.y = NSMaxY([goIncognitoButton frame]);
+ [container addSubview:goIncognitoButton];
+
+ NSBox* separator = [self horizontalSeparatorWithFrame:viewRect];
+ [container addSubview:separator];
+ viewRect.origin.y = NSMaxY([separator frame]);
+ }
+
NSString* text = isGuestSession_ ?
l10n_util::GetNSString(IDS_PROFILES_EXIT_GUEST) :
- l10n_util::GetNSString(IDS_PROFILES_MANAGE_USERS_BUTTON);
+ l10n_util::GetNSString(IDS_PROFILES_SWITCH_USERS_BUTTON);
+ if (!isGuestSession_ && switches::IsMaterialDesignUserMenu()) {
+ text = l10n_util::GetNSString(IDS_PROFILES_MANAGE_USERS_BUTTON);
+ }
NSButton* switchUsersButton =
[self hoverButtonWithRect:viewRect
text:text

Powered by Google App Engine
This is Rietveld 408576698