OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_WINDOW_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_UTILS_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_UTILS_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_UTILS_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
| 10 #include "chrome/browser/ui/cocoa/themed_window.h" |
| 11 |
10 class Browser; | 12 class Browser; |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 struct NativeWebKeyboardEvent; | 15 struct NativeWebKeyboardEvent; |
14 } | 16 } |
15 | 17 |
16 @interface BrowserWindowUtils : NSObject | 18 @interface BrowserWindowUtils : NSObject |
17 | 19 |
18 // Returns YES if keyboard event should be handled. | 20 // Returns YES if keyboard event should be handled. |
19 + (BOOL)shouldHandleKeyboardEvent:(const content::NativeWebKeyboardEvent&)event; | 21 + (BOOL)shouldHandleKeyboardEvent:(const content::NativeWebKeyboardEvent&)event; |
(...skipping 10 matching lines...) Expand all Loading... |
30 // around a Cocoa bug: if a window changes title during the tracking of the | 32 // around a Cocoa bug: if a window changes title during the tracking of the |
31 // Window menu it doesn't display well and the constant re-sorting of the list | 33 // Window menu it doesn't display well and the constant re-sorting of the list |
32 // makes it difficult for the user to pick the desired window. | 34 // makes it difficult for the user to pick the desired window. |
33 // Passing in a non-nil oldTitle will also cancel any pending title changes with | 35 // Passing in a non-nil oldTitle will also cancel any pending title changes with |
34 // a matching window and title. This function returns a NSString* that can be | 36 // a matching window and title. This function returns a NSString* that can be |
35 // passed in future calls as oldTitle. | 37 // passed in future calls as oldTitle. |
36 + (NSString*)scheduleReplaceOldTitle:(NSString*)oldTitle | 38 + (NSString*)scheduleReplaceOldTitle:(NSString*)oldTitle |
37 withNewTitle:(NSString*)newTitle | 39 withNewTitle:(NSString*)newTitle |
38 forWindow:(NSWindow*)window; | 40 forWindow:(NSWindow*)window; |
39 | 41 |
40 + (NSPoint)themePatternPhaseFor:(NSView*)windowView | 42 // Returns the position in the coordinates of |windowView| that the top left of |
41 withTabStrip:(NSView*)tabStripView; | 43 // a theme image should be painted at. See |
| 44 // [BrowserWindowController themeImagePositionForAlignment:] for more details. |
| 45 + (NSPoint)themeImagePositionFor:(NSView*)windowView |
| 46 withTabStrip:(NSView*)tabStripView |
| 47 alignment:(ThemeImageAlignment)alignment; |
| 48 |
| 49 // Returns the position in the coordinates of |tabStripView| that the top left |
| 50 // of a theme image should be painted at. This method exists so that the |
| 51 // position can be queried by the new tab button before the tab strip is layed |
| 52 // out. |
| 53 + (NSPoint)themeImagePositionInTabStripCoords:(NSView*)tabStripView |
| 54 alignment:(ThemeImageAlignment)alignment; |
42 | 55 |
43 + (void)activateWindowForController:(NSWindowController*)controller; | 56 + (void)activateWindowForController:(NSWindowController*)controller; |
44 @end | 57 @end |
45 | 58 |
46 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_UTILS_H_ | 59 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_UTILS_H_ |
OLD | NEW |