| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 class Browser; | 11 class Browser; |
| 12 struct NativeWebKeyboardEvent; | 12 struct NativeWebKeyboardEvent; |
| 13 | 13 |
| 14 @interface BrowserWindowUtils : NSObject | 14 @interface BrowserWindowUtils : NSObject |
| 15 | 15 |
| 16 // Returns YES if keyboard event should be handled. | 16 // Returns YES if keyboard event should be handled. |
| 17 + (BOOL)shouldHandleKeyboardEvent:(const NativeWebKeyboardEvent&)event; | 17 + (BOOL)shouldHandleKeyboardEvent:(const NativeWebKeyboardEvent&)event; |
| 18 | 18 |
| 19 // Determines the command associated with the keyboard event. | 19 // Determines the command associated with the keyboard event. |
| 20 // Returns -1 if no command found. | 20 // Returns -1 if no command found. |
| 21 + (int)getCommandId:(const NativeWebKeyboardEvent&)event; | 21 + (int)getCommandId:(const NativeWebKeyboardEvent&)event; |
| 22 | 22 |
| 23 // NSWindow must be a ChromeEventProcessingWindow. | 23 // NSWindow must be a ChromeEventProcessingWindow. |
| 24 + (BOOL)handleKeyboardEvent:(NSEvent*)event | 24 + (BOOL)handleKeyboardEvent:(NSEvent*)event |
| 25 inWindow:(NSWindow*)window; | 25 inWindow:(NSWindow*)window; |
| 26 |
| 27 // Work around Cocoa bug: if a window changes title during the tracking of the |
| 28 // Window menu it doesn't display well and the constant re-sorting of the list |
| 29 // makes it difficult for the user to pick the desired window. Delay window |
| 30 // title updates until the default run-loop mode. |
| 31 + (void)delayedReplace:(NSString*)oldTitle |
| 32 with:(NSString*)newTitle |
| 33 on:(NSWindow*)window; |
| 34 |
| 35 + (NSPoint)themePatternPhaseFor:(NSView*)windowView |
| 36 withTabStrip:(NSView*)tabStripView; |
| 26 @end | 37 @end |
| 27 | 38 |
| 28 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_UTILS_H_ | 39 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_UTILS_H_ |
| OLD | NEW |