OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_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 #include "base/memory/scoped_nsobject.h" | 14 #include "base/mac/scoped_nsobject.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #import "chrome/browser/ui/cocoa/chrome_browser_window.h" | 16 #import "chrome/browser/ui/cocoa/chrome_browser_window.h" |
17 #include "chrome/browser/ui/panels/panel.h" | 17 #include "chrome/browser/ui/panels/panel.h" |
18 | 18 |
19 class PanelCocoa; | 19 class PanelCocoa; |
20 @class PanelTitlebarViewCocoa; | 20 @class PanelTitlebarViewCocoa; |
21 | 21 |
22 @interface PanelWindowCocoaImpl : ChromeBrowserWindow { | 22 @interface PanelWindowCocoaImpl : ChromeBrowserWindow { |
23 } | 23 } |
24 @end | 24 @end |
25 | 25 |
26 @interface PanelWindowControllerCocoa : NSWindowController | 26 @interface PanelWindowControllerCocoa : NSWindowController |
27 <NSWindowDelegate, | 27 <NSWindowDelegate, |
28 NSAnimationDelegate> { | 28 NSAnimationDelegate> { |
29 @private | 29 @private |
30 IBOutlet PanelTitlebarViewCocoa* titlebar_view_; | 30 IBOutlet PanelTitlebarViewCocoa* titlebar_view_; |
31 scoped_ptr<PanelCocoa> windowShim_; | 31 scoped_ptr<PanelCocoa> windowShim_; |
32 scoped_nsobject<NSString> pendingWindowTitle_; | 32 base::scoped_nsobject<NSString> pendingWindowTitle_; |
33 NSViewAnimation* boundsAnimation_; // Lifetime controlled manually, needs | 33 NSViewAnimation* boundsAnimation_; // Lifetime controlled manually, needs |
34 // more then just |release| to terminate. | 34 // more then just |release| to terminate. |
35 BOOL animateOnBoundsChange_; | 35 BOOL animateOnBoundsChange_; |
36 BOOL throbberShouldSpin_; | 36 BOOL throbberShouldSpin_; |
37 BOOL playingMinimizeAnimation_; | 37 BOOL playingMinimizeAnimation_; |
38 float animationStopToShowTitlebarOnly_; | 38 float animationStopToShowTitlebarOnly_; |
39 BOOL canBecomeKeyWindow_; | 39 BOOL canBecomeKeyWindow_; |
40 // Allow a panel to become key if activated via Panel logic, as opposed | 40 // Allow a panel to become key if activated via Panel logic, as opposed |
41 // to by default system selection. The system will prefer a panel | 41 // to by default system selection. The system will prefer a panel |
42 // window over other application windows due to panels having a higher | 42 // window over other application windows due to panels having a higher |
43 // priority NSWindowLevel, so we distinguish between the two scenarios. | 43 // priority NSWindowLevel, so we distinguish between the two scenarios. |
44 BOOL activationRequestedByPanel_; | 44 BOOL activationRequestedByPanel_; |
45 scoped_nsobject<NSView> overlayView_; | 45 base::scoped_nsobject<NSView> overlayView_; |
46 } | 46 } |
47 | 47 |
48 // Load the window nib and do any Cocoa-specific initialization. | 48 // Load the window nib and do any Cocoa-specific initialization. |
49 - (id)initWithPanel:(PanelCocoa*)window; | 49 - (id)initWithPanel:(PanelCocoa*)window; |
50 | 50 |
51 - (void)webContentsInserted:(content::WebContents*)contents; | 51 - (void)webContentsInserted:(content::WebContents*)contents; |
52 - (void)webContentsDetached:(content::WebContents*)contents; | 52 - (void)webContentsDetached:(content::WebContents*)contents; |
53 | 53 |
54 - (void)updateWebContentsViewFrame; | 54 - (void)updateWebContentsViewFrame; |
55 | 55 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 - (void)miniaturize; | 144 - (void)miniaturize; |
145 // Returns true if the window is minimized to the dock. | 145 // Returns true if the window is minimized to the dock. |
146 - (BOOL)isMiniaturized; | 146 - (BOOL)isMiniaturized; |
147 | 147 |
148 - (NSRect)frameRectForContentRect:(NSRect)contentRect; | 148 - (NSRect)frameRectForContentRect:(NSRect)contentRect; |
149 - (NSRect)contentRectForFrameRect:(NSRect)frameRect; | 149 - (NSRect)contentRectForFrameRect:(NSRect)frameRect; |
150 | 150 |
151 @end // @interface PanelWindowController | 151 @end // @interface PanelWindowController |
152 | 152 |
153 #endif // CHROME_BROWSER_UI_COCOA_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ | 153 #endif // CHROME_BROWSER_UI_COCOA_PANELS_PANEL_WINDOW_CONTROLLER_COCOA_H_ |
OLD | NEW |