Index: chrome/browser/cocoa/browser_window_controller.mm |
=================================================================== |
--- chrome/browser/cocoa/browser_window_controller.mm (revision 16871) |
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy) |
@@ -309,6 +309,11 @@ |
// Generate return value (enabled state) |
enable = browser_->command_updater()->IsCommandEnabled(tag) ? YES : NO; |
+ // Disable "close tab" if we're not the key window or if there's only |
+ // one tab. |
+ if (tag == IDC_CLOSE_TAB) |
+ enable &= [self numberOfTabs] > 1 && [[self window] isKeyWindow]; |
+ |
// If the item is toggleable, find it's toggle state and |
// try to update it. This is a little awkward, but the alternative is |
// to check after a commandDispatch, which seems worse. |