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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 1248183004: [Mac] added support for show as tab on popups, similar behavior that exists in windows in which rep… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index e657c7727b9d5a06457e57b7978d557b817171d4..6cd8421d6a657e4b00a0bf6810c7b8c887b1695c 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1122,6 +1122,18 @@ using content::WebContents;
// Generate return value (enabled state)
enable = chrome::IsCommandEnabled(browser_.get(), tag);
switch (tag) {
+ case IDC_SHOW_AS_TAB:
+ if (NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item)) {
+ bool shouldHide = browser_->is_type_tabbed();
+ [menuItem setHidden:shouldHide];
+ }
+ break;
+ case IDC_NEW_TAB:
+ if (NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item)) {
+ bool shouldHide = !browser_->is_type_tabbed();
+ [menuItem setHidden:shouldHide];
+ }
+ break;
case IDC_CLOSE_TAB:
// Disable "close tab" if the receiving window is not tabbed.
// We simply check whether the item has a keyboard shortcut set here;
« no previous file with comments | « chrome/app/nibs/MainMenu.xib ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698