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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 1681863005: Added the "Show as Tab" option for popups on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « chrome/app/nibs/MainMenu.xib ('k') | chrome/browser/ui/cocoa/browser_window_command_handler.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index d9eceb7e699a1c6e103afbc9eb876896ca1e2c0a..e33ff8e3294d57c921d74ea0a51bcdfeb029d68e 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -982,6 +982,16 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
![self keyWindowIsModal] : NO;
}
}
+
+ // "Show as tab" should only appear when the current window is a popup.
+ // Since |validateUserInterfaceItem:| is called only when there are no
+ // key windows, we should just hide this.
+ // This is handled outside of the switch statement because we want to hide
+ // this regardless if the command is supported or not.
+ if (tag == IDC_SHOW_AS_TAB) {
+ NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
+ [menuItem setHidden:YES];
+ }
} else if (action == @selector(terminate:)) {
enable = YES;
} else if (action == @selector(showPreferences:)) {
« no previous file with comments | « chrome/app/nibs/MainMenu.xib ('k') | chrome/browser/ui/cocoa/browser_window_command_handler.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698