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_COCOA_CHROME_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ |
6 #define CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ | 6 #define CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 // Cocoa class representing a Chrome browser window. | 10 // Cocoa class representing a Chrome browser window. |
11 // We need to override NSWindow with our own class since we need access to all | 11 // We need to override NSWindow with our own class since we need access to all |
12 // unhandled keyboard events and subclassing NSWindow is the only method to do | 12 // unhandled keyboard events and subclassing NSWindow is the only method to do |
13 // this. | 13 // this. |
14 @interface ChromeBrowserWindow : NSWindow { | 14 @interface ChromeBrowserWindow : NSWindow { |
15 BOOL shouldHideTitle_; | 15 BOOL shouldHideTitle_; |
16 } | 16 } |
17 | 17 |
| 18 // See global_keyboard_shortcuts_mac.h for details on the next two functions. |
| 19 |
| 20 // Checks if |event| is a window keyboard shortcut. If so, dispatches it to the |
| 21 // window controller's |executeCommand:| and returns |YES|. |
| 22 - (BOOL)handleExtraWindowKeyboardShortcut:(NSEvent*)event; |
| 23 |
| 24 // Checks if |event| is a browser keyboard shortcut. If so, dispatches it to the |
| 25 // window controller's |executeCommand:| and returns |YES|. |
| 26 - (BOOL)handleExtraBrowserKeyboardShortcut:(NSEvent*)event; |
| 27 |
18 // Override, so we can handle global keyboard events. | 28 // Override, so we can handle global keyboard events. |
19 - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; | 29 - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; |
20 | 30 |
21 // Tells the window to suppress title drawing. | 31 // Tells the window to suppress title drawing. |
22 - (void)setShouldHideTitle:(BOOL)flag; | 32 - (void)setShouldHideTitle:(BOOL)flag; |
23 | 33 |
24 @end | 34 @end |
25 | 35 |
26 @interface ChromeBrowserWindow (UndocumentedAPI) | 36 @interface ChromeBrowserWindow (UndocumentedAPI) |
27 | 37 |
28 // Undocumented Cocoa API to suppress drawing of the window's title. | 38 // Undocumented Cocoa API to suppress drawing of the window's title. |
29 // -setTitle: still works, but the title set only applies to the | 39 // -setTitle: still works, but the title set only applies to the |
30 // miniwindow and menus (and, importantly, Expose). Overridden to | 40 // miniwindow and menus (and, importantly, Expose). Overridden to |
31 // return |shouldHideTitle_|. | 41 // return |shouldHideTitle_|. |
32 -(BOOL)_isTitleHidden; | 42 -(BOOL)_isTitleHidden; |
33 | 43 |
34 @end | 44 @end |
35 | 45 |
36 #endif // CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ | 46 #endif // CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ |
OLD | NEW |