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

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

Issue 8302021: Prevent extension and bookmark popups from interfering with close window/tab shortcuts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Just check parent, no grandparents; restore NSValidatedUserInterfaceItem type Created 9 years, 2 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/browser/app_controller_mac.mm ('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 cfef089d9a43841faaeb5a07c3909ac0366000c7..f5fbb11846ea3ad926fa0b7da65079955152aeaa 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1000,9 +1000,12 @@ enum {
enable = browser_->command_updater()->IsCommandEnabled(tag);
switch (tag) {
case IDC_CLOSE_TAB:
- // Disable "close tab" if we're not the key window or if there's only
- // one tab.
- enable &= [[self window] isKeyWindow];
+ // Disable "close tab" if the receiving window is not tabbed.
+ // We simply check whether the item has a keyboard shortcut set here;
+ // app_controller_mac.mm actually determines whether the item should
+ // be enabled.
+ if ([static_cast<NSObject*>(item) isKindOfClass:[NSMenuItem class]])
+ enable &= !![[static_cast<NSMenuItem*>(item) keyEquivalent] length];
break;
case IDC_FULLSCREEN: {
enable &= [self supportsFullscreen];
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698