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_BROWSER_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 // A class acting as the Objective-C controller for the Browser | 8 // A class acting as the Objective-C controller for the Browser |
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 toolbar and, by virtue of being a | 10 // code. Each window has a single toolbar and, by virtue of being a |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 @class TranslateBubbleController; | 50 @class TranslateBubbleController; |
51 | 51 |
52 namespace content { | 52 namespace content { |
53 class WebContents; | 53 class WebContents; |
54 } | 54 } |
55 | 55 |
56 namespace extensions { | 56 namespace extensions { |
57 class Command; | 57 class Command; |
58 } | 58 } |
59 | 59 |
60 namespace fullscreen_mac { | |
61 enum SlidingStyle { | |
62 OMNIBOX_TABS_PRESENT = 0, // Tab strip and omnibox both visible. | |
63 OMNIBOX_PRESENT, // Tab strip hidden. | |
64 OMNIBOX_TABS_HIDDEN, // Tab strip and omnibox both hidden. | |
65 }; | |
66 } // namespace fullscreen_mac | |
67 | |
68 @interface BrowserWindowController : | 60 @interface BrowserWindowController : |
69 TabWindowController<NSUserInterfaceValidations, | 61 TabWindowController<NSUserInterfaceValidations, |
70 BookmarkBarControllerDelegate, | 62 BookmarkBarControllerDelegate, |
71 BrowserCommandExecutor, | 63 BrowserCommandExecutor, |
72 ViewResizer, | 64 ViewResizer, |
73 TabStripControllerDelegate> { | 65 TabStripControllerDelegate> { |
74 @private | 66 @private |
75 // The ordering of these members is important as it determines the order in | 67 // The ordering of these members is important as it determines the order in |
76 // which they are destroyed. |browser_| needs to be destroyed last as most of | 68 // which they are destroyed. |browser_| needs to be destroyed last as most of |
77 // the other objects hold weak references to it or things it owns | 69 // the other objects hold weak references to it or things it owns |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 base::scoped_nsobject<NSWindow> fullscreenWindow_; | 127 base::scoped_nsobject<NSWindow> fullscreenWindow_; |
136 | 128 |
137 // The Cocoa implementation of the PermissionBubbleView. | 129 // The Cocoa implementation of the PermissionBubbleView. |
138 scoped_ptr<PermissionBubbleCocoa> permissionBubbleCocoa_; | 130 scoped_ptr<PermissionBubbleCocoa> permissionBubbleCocoa_; |
139 | 131 |
140 // True between |-windowWillEnterFullScreen:| and |-windowDidEnterFullScreen:| | 132 // True between |-windowWillEnterFullScreen:| and |-windowDidEnterFullScreen:| |
141 // to indicate that the window is in the process of transitioning into | 133 // to indicate that the window is in the process of transitioning into |
142 // AppKit fullscreen mode. | 134 // AppKit fullscreen mode. |
143 BOOL enteringAppKitFullscreen_; | 135 BOOL enteringAppKitFullscreen_; |
144 | 136 |
| 137 // Only adjust the tab strip once while entering fullscreen. See the |
| 138 // implementation of -[BrowserWindowController updateSubviewZOrder:] for more |
| 139 // details. |
| 140 BOOL hasAdjustedTabStripWhileEnteringAppKitFullscreen_; |
| 141 |
145 // True between |enterImmersiveFullscreen| and |-windowDidEnterFullScreen:| | 142 // True between |enterImmersiveFullscreen| and |-windowDidEnterFullScreen:| |
146 // to indicate that the window is in the process of transitioning into | 143 // to indicate that the window is in the process of transitioning into |
147 // AppKit fullscreen mode. | 144 // AppKit fullscreen mode. |
148 BOOL enteringImmersiveFullscreen_; | 145 BOOL enteringImmersiveFullscreen_; |
149 | 146 |
150 // True between |-setPresentationMode:url:bubbleType:| and | 147 // True between |-setPresentationMode:url:bubbleType:| and |
151 // |-windowDidEnterFullScreen:| to indicate that the window is in the process | 148 // |-windowDidEnterFullScreen:| to indicate that the window is in the process |
152 // of transitioning into fullscreen presentation mode. | 149 // of transitioning into fullscreen presentation mode. |
153 BOOL enteringPresentationMode_; | 150 BOOL enteringPresentationMode_; |
154 | 151 |
155 // The size of the original (non-fullscreen) window. This is saved just | 152 // The size of the original (non-fullscreen) window. This is saved just |
156 // before entering fullscreen mode and is only valid when |-isFullscreen| | 153 // before entering fullscreen mode and is only valid when |-isFullscreen| |
157 // returns YES. | 154 // returns YES. |
158 NSRect savedRegularWindowFrame_; | 155 NSRect savedRegularWindowFrame_; |
159 | 156 |
160 // The proportion of the floating bar which is shown (in presentation mode). | 157 // The proportion of the floating bar which is shown (in presentation mode). |
161 CGFloat floatingBarShownFraction_; | 158 CGFloat floatingBarShownFraction_; |
162 | 159 |
163 // Whether the omnibox is hidden in fullscreen. | |
164 fullscreen_mac::SlidingStyle fullscreenStyle_; | |
165 | |
166 // Various UI elements/events may want to ensure that the floating bar is | 160 // Various UI elements/events may want to ensure that the floating bar is |
167 // visible (in presentation mode), e.g., because of where the mouse is or | 161 // visible (in presentation mode), e.g., because of where the mouse is or |
168 // where keyboard focus is. Whenever an object requires bar visibility, it has | 162 // where keyboard focus is. Whenever an object requires bar visibility, it has |
169 // itself added to |barVisibilityLocks_|. When it no longer requires bar | 163 // itself added to |barVisibilityLocks_|. When it no longer requires bar |
170 // visibility, it has itself removed. | 164 // visibility, it has itself removed. |
171 base::scoped_nsobject<NSMutableSet> barVisibilityLocks_; | 165 base::scoped_nsobject<NSMutableSet> barVisibilityLocks_; |
172 | 166 |
173 // Bar visibility locks and releases only result (when appropriate) in changes | 167 // Bar visibility locks and releases only result (when appropriate) in changes |
174 // in visible state when the following is |YES|. | 168 // in visible state when the following is |YES|. |
175 BOOL barVisibilityUpdatesEnabled_; | 169 BOOL barVisibilityUpdatesEnabled_; |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 511 |
518 // Whether the system is in the very specific fullscreen mode: Presentation | 512 // Whether the system is in the very specific fullscreen mode: Presentation |
519 // Mode. | 513 // Mode. |
520 - (BOOL)inPresentationMode; | 514 - (BOOL)inPresentationMode; |
521 | 515 |
522 // Resizes the fullscreen window to fit the screen it's currently on. Called by | 516 // Resizes the fullscreen window to fit the screen it's currently on. Called by |
523 // the PresentationModeController when there is a change in monitor placement or | 517 // the PresentationModeController when there is a change in monitor placement or |
524 // resolution. | 518 // resolution. |
525 - (void)resizeFullscreenWindow; | 519 - (void)resizeFullscreenWindow; |
526 | 520 |
527 // Gets or sets the fraction of the floating bar (presentation mode overlay) | |
528 // that is shown. 0 is completely hidden, 1 is fully shown. | |
529 - (CGFloat)floatingBarShownFraction; | |
530 - (void)setFloatingBarShownFraction:(CGFloat)fraction; | |
531 | |
532 // Query/lock/release the requirement that the tab strip/toolbar/attached | 521 // Query/lock/release the requirement that the tab strip/toolbar/attached |
533 // bookmark bar bar cluster is visible (e.g., when one of its elements has | 522 // bookmark bar bar cluster is visible (e.g., when one of its elements has |
534 // focus). This is required for the floating bar in presentation mode, but | 523 // focus). This is required for the floating bar in presentation mode, but |
535 // should also be called when not in presentation mode; see the comments for | 524 // should also be called when not in presentation mode; see the comments for |
536 // |barVisibilityLocks_| for more details. Double locks/releases by the same | 525 // |barVisibilityLocks_| for more details. Double locks/releases by the same |
537 // owner are ignored. If |animate:| is YES, then an animation may be performed, | 526 // owner are ignored. If |animate:| is YES, then an animation may be performed, |
538 // possibly after a small delay if |delay:| is YES. If |animate:| is NO, | 527 // possibly after a small delay if |delay:| is YES. If |animate:| is NO, |
539 // |delay:| will be ignored. In the case of multiple calls, later calls have | 528 // |delay:| will be ignored. In the case of multiple calls, later calls have |
540 // precedence with the rule that |animate:NO| has precedence over |animate:YES|, | 529 // precedence with the rule that |animate:NO| has precedence over |animate:YES|, |
541 // and |delay:NO| has precedence over |delay:YES|. | 530 // and |delay:NO| has precedence over |delay:YES|. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 // positioned relative to. | 582 // positioned relative to. |
594 - (NSRect)omniboxPopupAnchorRect; | 583 - (NSRect)omniboxPopupAnchorRect; |
595 | 584 |
596 // Force a layout of info bars. | 585 // Force a layout of info bars. |
597 - (void)layoutInfoBars; | 586 - (void)layoutInfoBars; |
598 | 587 |
599 @end // @interface BrowserWindowController (TestingAPI) | 588 @end // @interface BrowserWindowController (TestingAPI) |
600 | 589 |
601 | 590 |
602 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 591 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |