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_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ |
7 | 7 |
8 // A class acting as the Objective-C controller for the Panel window | 8 // A class acting as the Objective-C controller for the Panel window |
9 // object. Handles interactions between Cocoa and the cross-platform | 9 // object. Handles interactions between Cocoa and the cross-platform |
10 // code. Each window has a single titlebar and is managed/owned by Panel. | 10 // code. Each window has a single titlebar and is managed/owned by Panel. |
11 | 11 |
12 #import <Cocoa/Cocoa.h> | 12 #import <Cocoa/Cocoa.h> |
13 | 13 |
14 #import "base/mac/cocoa_protocols.h" | 14 #import "base/mac/cocoa_protocols.h" |
| 15 #include "base/memory/scoped_nsobject.h" |
15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #import "chrome/browser/ui/cocoa/themed_window.h" |
16 | 18 |
17 @class FindBarCocoaController; | 19 @class FindBarCocoaController; |
18 class PanelBrowserWindowCocoa; | 20 class PanelBrowserWindowCocoa; |
19 @class PanelTitlebarViewCocoa; | 21 @class PanelTitlebarViewCocoa; |
20 | 22 |
21 @interface PanelWindowControllerCocoa : NSWindowController<NSWindowDelegate> { | 23 @interface PanelWindowControllerCocoa : NSWindowController<NSWindowDelegate> { |
22 @private | 24 @private |
23 IBOutlet PanelTitlebarViewCocoa* titlebar_view_; | 25 IBOutlet PanelTitlebarViewCocoa* titlebar_view_; |
24 scoped_ptr<PanelBrowserWindowCocoa> windowShim_; | 26 scoped_ptr<PanelBrowserWindowCocoa> windowShim_; |
| 27 scoped_nsobject<NSString> pendingWindowTitle_; |
25 } | 28 } |
26 | 29 |
27 // Load the browser window nib and do any Cocoa-specific initialization. | 30 // Load the browser window nib and do any Cocoa-specific initialization. |
28 - (id)initWithBrowserWindow:(PanelBrowserWindowCocoa*)window; | 31 - (id)initWithBrowserWindow:(PanelBrowserWindowCocoa*)window; |
29 | 32 |
| 33 - (ui::ThemeProvider*)themeProvider; |
| 34 - (ThemedWindowStyle)themedWindowStyle; |
| 35 - (NSPoint)themePatternPhase; |
| 36 |
30 // Returns the TabContents' native view. It renders the content of the web page | 37 // Returns the TabContents' native view. It renders the content of the web page |
31 // in the Panel. | 38 // in the Panel. |
32 - (NSView*)tabContentsView; | 39 - (NSView*)tabContentsView; |
33 | 40 |
34 // Sometimes (when we animate the size of the window) we want to stop resizing | 41 // Sometimes (when we animate the size of the window) we want to stop resizing |
35 // the TabContents's cocoa view to avoid unnecessary churn and issues | 42 // the TabContents's cocoa view to avoid unnecessary churn and issues |
36 // that can be caused by sizes near 0. | 43 // that can be caused by sizes near 0. |
37 - (void)disableTabContentsViewAutosizing; | 44 - (void)disableTabContentsViewAutosizing; |
38 - (void)enableTabContentsViewAutosizing; | 45 - (void)enableTabContentsViewAutosizing; |
39 | 46 |
40 // Shows the window for the first time. Only happens once. | 47 // Shows the window for the first time. Only happens once. |
41 - (void)revealAnimatedWithFrame:(const NSRect&)frame; | 48 - (void)revealAnimatedWithFrame:(const NSRect&)frame; |
42 | 49 |
| 50 - (void)updateTitleBar; |
| 51 |
43 // Adds the FindBar controller's view to this Panel. Must only be | 52 // Adds the FindBar controller's view to this Panel. Must only be |
44 // called once per PanelWindowControllerCocoa. | 53 // called once per PanelWindowControllerCocoa. |
45 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; | 54 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; |
46 | 55 |
47 // Initiate the closing of the panel, starting from the platform-independent | 56 // Initiate the closing of the panel, starting from the platform-independent |
48 // layer. This will take care of PanelManager, other panels and close the | 57 // layer. This will take care of PanelManager, other panels and close the |
49 // native window at the end. | 58 // native window at the end. |
50 - (void)closePanel; | 59 - (void)closePanel; |
51 | 60 |
52 // Accessor for titlebar view. | 61 // Accessor for titlebar view. |
53 - (PanelTitlebarViewCocoa*)titlebarView; | 62 - (PanelTitlebarViewCocoa*)titlebarView; |
54 | 63 |
55 @end // @interface PanelWindowController | 64 @end // @interface PanelWindowController |
56 | 65 |
57 #endif // CHROME_BROWSER_UI_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ | 66 #endif // CHROME_BROWSER_UI_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ |
OLD | NEW |