Chromium Code Reviews| Index: chrome/browser/ui/cocoa/nsmenuitem_additions.mm |
| diff --git a/chrome/browser/ui/cocoa/nsmenuitem_additions.mm b/chrome/browser/ui/cocoa/nsmenuitem_additions.mm |
| index 90bb35347239b7febabbe26b728d5d2042583303..1799eb04e9e6527af382e5538a7c086148cc517b 100644 |
| --- a/chrome/browser/ui/cocoa/nsmenuitem_additions.mm |
| +++ b/chrome/browser/ui/cocoa/nsmenuitem_additions.mm |
| @@ -11,10 +11,13 @@ |
| @implementation NSMenuItem(ChromeAdditions) |
| - (BOOL)cr_firesForKeyEvent:(NSEvent*)event { |
|
Ilya Sherman
2010/12/06 18:45:27
nit: It seems weird to me to leave this function a
|
| - DCHECK([event type] == NSKeyDown); |
| if (![self isEnabled]) |
| return NO; |
| + return [self cr_firesForKeyEventIfEnabled:event]; |
| +} |
| +- (BOOL)cr_firesForKeyEventIfEnabled:(NSEvent*)event { |
| + DCHECK([event type] == NSKeyDown); |
| // In System Preferences->Keyboard->Keyboard Shortcuts, it is possible to add |
| // arbitrary keyboard shortcuts to applications. It is not documented how this |
| // works in detail, but |NSMenuItem| has a method |userKeyEquivalent| that |