| 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" |
| 16 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | 17 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
| 18 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 17 | 19 |
| 18 @class FindBarCocoaController; | 20 @class FindBarCocoaController; |
| 19 class PanelBrowserWindowCocoa; | 21 class PanelBrowserWindowCocoa; |
| 20 @class PanelTitlebarViewCocoa; | 22 @class PanelTitlebarViewCocoa; |
| 21 | 23 |
| 22 @interface PanelWindowControllerCocoa : NSWindowController<NSWindowDelegate, | 24 @interface PanelWindowControllerCocoa : NSWindowController<NSWindowDelegate, |
| 23 BrowserCommandExecutor> { | 25 BrowserCommandExecutor> { |
| 24 @private | 26 @private |
| 25 IBOutlet PanelTitlebarViewCocoa* titlebar_view_; | 27 IBOutlet PanelTitlebarViewCocoa* titlebar_view_; |
| 26 scoped_ptr<PanelBrowserWindowCocoa> windowShim_; | 28 scoped_ptr<PanelBrowserWindowCocoa> windowShim_; |
| 29 scoped_nsobject<NSString> pendingWindowTitle_; |
| 27 } | 30 } |
| 28 | 31 |
| 29 // Load the browser window nib and do any Cocoa-specific initialization. | 32 // Load the browser window nib and do any Cocoa-specific initialization. |
| 30 - (id)initWithBrowserWindow:(PanelBrowserWindowCocoa*)window; | 33 - (id)initWithBrowserWindow:(PanelBrowserWindowCocoa*)window; |
| 31 | 34 |
| 35 - (ui::ThemeProvider*)themeProvider; |
| 36 - (ThemedWindowStyle)themedWindowStyle; |
| 37 - (NSPoint)themePatternPhase; |
| 38 |
| 32 // Returns the TabContents' native view. It renders the content of the web page | 39 // Returns the TabContents' native view. It renders the content of the web page |
| 33 // in the Panel. | 40 // in the Panel. |
| 34 - (NSView*)tabContentsView; | 41 - (NSView*)tabContentsView; |
| 35 | 42 |
| 36 // Sometimes (when we animate the size of the window) we want to stop resizing | 43 // Sometimes (when we animate the size of the window) we want to stop resizing |
| 37 // the TabContents's cocoa view to avoid unnecessary churn and issues | 44 // the TabContents's cocoa view to avoid unnecessary churn and issues |
| 38 // that can be caused by sizes near 0. | 45 // that can be caused by sizes near 0. |
| 39 - (void)disableTabContentsViewAutosizing; | 46 - (void)disableTabContentsViewAutosizing; |
| 40 - (void)enableTabContentsViewAutosizing; | 47 - (void)enableTabContentsViewAutosizing; |
| 41 | 48 |
| 42 // Shows the window for the first time. Only happens once. | 49 // Shows the window for the first time. Only happens once. |
| 43 - (void)revealAnimatedWithFrame:(const NSRect&)frame; | 50 - (void)revealAnimatedWithFrame:(const NSRect&)frame; |
| 44 | 51 |
| 52 - (void)updateTitleBar; |
| 53 |
| 45 // Adds the FindBar controller's view to this Panel. Must only be | 54 // Adds the FindBar controller's view to this Panel. Must only be |
| 46 // called once per PanelWindowControllerCocoa. | 55 // called once per PanelWindowControllerCocoa. |
| 47 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; | 56 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; |
| 48 | 57 |
| 49 // Initiate the closing of the panel, starting from the platform-independent | 58 // Initiate the closing of the panel, starting from the platform-independent |
| 50 // layer. This will take care of PanelManager, other panels and close the | 59 // layer. This will take care of PanelManager, other panels and close the |
| 51 // native window at the end. | 60 // native window at the end. |
| 52 - (void)closePanel; | 61 - (void)closePanel; |
| 53 | 62 |
| 54 // Accessor for titlebar view. | 63 // Accessor for titlebar view. |
| 55 - (PanelTitlebarViewCocoa*)titlebarView; | 64 - (PanelTitlebarViewCocoa*)titlebarView; |
| 56 | 65 |
| 57 // Executes the command in the context of the current browser. | 66 // Executes the command in the context of the current browser. |
| 58 // |command| is an integer value containing one of the constants defined in the | 67 // |command| is an integer value containing one of the constants defined in the |
| 59 // "chrome/app/chrome_command_ids.h" file. | 68 // "chrome/app/chrome_command_ids.h" file. |
| 60 - (void)executeCommand:(int)command; | 69 - (void)executeCommand:(int)command; |
| 61 | 70 |
| 62 @end // @interface PanelWindowController | 71 @end // @interface PanelWindowController |
| 63 | 72 |
| 64 #endif // CHROME_BROWSER_UI_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ | 73 #endif // CHROME_BROWSER_UI_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ |
| OLD | NEW |