Chromium Code Reviews| 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 45a5e51f3843fd88ceae33acc820269830b9b068..796d9cc969b23052f7ec04247e0c690553e313cc 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_controller.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm |
| @@ -985,7 +985,7 @@ enum { |
| // although we could cheat and directly ask the app controller if our |
| // command_updater doesn't support the command. This may or may not be an issue, |
| // too early to tell. |
| -- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { |
| +- (BOOL)validateUserInterfaceItem:(NSMenuItem*)item { |
|
Scott Hess - ex-Googler
2011/10/25 23:40:59
I'm not sure this is only NSMenuItem*. If it defi
Ilya Sherman
2011/10/26 23:22:40
Oh, I missed those below. It seems weird that thi
|
| SEL action = [item action]; |
| BOOL enable = NO; |
| if (action == @selector(commandDispatch:) || |
| @@ -996,9 +996,11 @@ 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. |
| + enable &= !![[item keyEquivalent] length]; |
| break; |
| case IDC_FULLSCREEN: { |
| enable &= [self supportsFullscreen]; |