OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_COCOA_NSMENUITEM_ADDITIONS_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_NSMENUITEM_ADDITIONS_H_ |
6 #define CHROME_BROWSER_UI_COCOA_NSMENUITEM_ADDITIONS_H_ | 6 #define CHROME_BROWSER_UI_COCOA_NSMENUITEM_ADDITIONS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 @interface NSMenuItem(ChromeAdditions) | 11 @interface NSMenuItem(ChromeAdditions) |
12 | 12 |
13 // Returns true exactly if the menu item would fire if it would be put into | 13 // Returns true exactly if the menu item would fire if it would be put into |
14 // a menu and then |menu performKeyEquivalent:event| was called. | 14 // a menu and then |menu performKeyEquivalent:event| was called. |
| 15 // This method always returns NO if the menu item is not enabled. |
15 - (BOOL)cr_firesForKeyEvent:(NSEvent*)event; | 16 - (BOOL)cr_firesForKeyEvent:(NSEvent*)event; |
16 | 17 |
| 18 // Like above method, but this method matches the key equivalent regardless of |
| 19 // the menu item's enable state. |
| 20 - (BOOL)cr_firesForKeyEventIfEnabled:(NSEvent*)event; |
| 21 |
17 @end | 22 @end |
18 | 23 |
19 #endif // CHROME_BROWSER_UI_COCOA_NSMENUITEM_ADDITIONS_H_ | 24 #endif // CHROME_BROWSER_UI_COCOA_NSMENUITEM_ADDITIONS_H_ |
OLD | NEW |