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:)) { |