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

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

Issue 5576002: Fix BrowserKeyEventsTest.ReservedAccelerators on Mac 10.6 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add cr_firesForKeyEventIfEnabled. Created 10 years 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/ui/cocoa/nsmenuitem_additions.h ('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/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
« no previous file with comments | « chrome/browser/ui/cocoa/nsmenuitem_additions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698