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_PRIVATE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ |
7 | 7 |
8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
10 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | 10 #import "chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h" |
11 | 11 |
12 @class BrowserWindowLayout; | 12 @class BrowserWindowLayout; |
13 class PermissionBubbleManager; | 13 class PermissionBubbleManager; |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class WebContents; | 16 class WebContents; |
17 } // content. | 17 } // content. |
18 | 18 |
19 // Private methods for the |BrowserWindowController|. This category should | 19 // Private methods for the |BrowserWindowController|. This category should |
20 // contain the private methods used by different parts of the BWC; private | 20 // contain the private methods used by different parts of the BWC; private |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression; | 66 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression; |
67 | 67 |
68 // Moves views between windows in preparation for fullscreen mode when not using | 68 // Moves views between windows in preparation for fullscreen mode when not using |
69 // Cocoa's System Fullscreen API. (System Fullscreen reuses the original window | 69 // Cocoa's System Fullscreen API. (System Fullscreen reuses the original window |
70 // for fullscreen mode, so there is no need to move views around.) This method | 70 // for fullscreen mode, so there is no need to move views around.) This method |
71 // does not position views; callers must also call |-layoutSubviews:|. | 71 // does not position views; callers must also call |-layoutSubviews:|. |
72 - (void)moveViewsForImmersiveFullscreen:(BOOL)fullscreen | 72 - (void)moveViewsForImmersiveFullscreen:(BOOL)fullscreen |
73 regularWindow:(NSWindow*)regularWindow | 73 regularWindow:(NSWindow*)regularWindow |
74 fullscreenWindow:(NSWindow*)fullscreenWindow; | 74 fullscreenWindow:(NSWindow*)fullscreenWindow; |
75 | 75 |
76 // Called when a permission bubble closes, and informs the presentation | 76 // Called when a permission bubble closes, and informs the fullscreen toolbar |
77 // controller that the dropdown can be hidden. (The dropdown should never be | 77 // controller that the dropdown can be hidden. (The dropdown should never be |
78 // hidden while a permissions bubble is visible.) | 78 // hidden while a permissions bubble is visible.) |
79 - (void)permissionBubbleWindowWillClose:(NSNotification*)notification; | 79 - (void)permissionBubbleWindowWillClose:(NSNotification*)notification; |
80 | 80 |
81 // Enter or exit fullscreen without using Cocoa's System Fullscreen API. These | 81 // Enter or exit fullscreen without using Cocoa's System Fullscreen API. These |
82 // methods are internal implementations of |-setFullscreen:|. | 82 // methods are internal implementations of |-setFullscreen:|. |
83 - (void)enterImmersiveFullscreen; | 83 - (void)enterImmersiveFullscreen; |
84 - (void)exitImmersiveFullscreen; | 84 - (void)exitImmersiveFullscreen; |
85 | 85 |
86 // Register or deregister for content view resize notifications. These | 86 // Register or deregister for content view resize notifications. These |
(...skipping 14 matching lines...) Expand all Loading... |
101 | 101 |
102 // The opacity for the toolbar divider; 0 means that it shouldn't be shown. | 102 // The opacity for the toolbar divider; 0 means that it shouldn't be shown. |
103 - (CGFloat)toolbarDividerOpacity; | 103 - (CGFloat)toolbarDividerOpacity; |
104 | 104 |
105 // Update visibility of the infobar tip, depending on the state of the window. | 105 // Update visibility of the infobar tip, depending on the state of the window. |
106 - (void)updateInfoBarTipVisibility; | 106 - (void)updateInfoBarTipVisibility; |
107 | 107 |
108 // The min Y of the bubble point in the coordinate space of the toolbar. | 108 // The min Y of the bubble point in the coordinate space of the toolbar. |
109 - (NSInteger)pageInfoBubblePointY; | 109 - (NSInteger)pageInfoBubblePointY; |
110 | 110 |
111 // Configures the presentationModeController_ right after it is constructed. | 111 // Configures the fullscreenToolbarController_ right after it is constructed. |
112 - (void)configurePresentationModeController; | 112 - (void)configureFullscreenToolbarController; |
113 | 113 |
114 // Allows the omnibox to slide. Also prepares UI for several fullscreen modes. | 114 // Allows the omnibox to slide. Also prepares UI for several fullscreen modes. |
115 // This method gets called when entering AppKit fullscren, or when entering | 115 // This method gets called when entering AppKit fullscren, or when entering |
116 // Immersive fullscreen. Expects fullscreenStyle_ to be set. | 116 // Immersive fullscreen. Expects fullscreenStyle_ to be set. |
117 - (void)adjustUIForSlidingFullscreenStyle:(fullscreen_mac::SlidingStyle)style; | 117 - (void)adjustUIForSlidingFullscreenStyle:(fullscreen_mac::SlidingStyle)style; |
118 | 118 |
119 // This method gets called when exiting AppKit fullscreen, or when exiting | 119 // This method gets called when exiting AppKit fullscreen, or when exiting |
120 // Immersive fullscreen. It performs some common UI changes, and stops the | 120 // Immersive fullscreen. It performs some common UI changes, and stops the |
121 // omnibox from sliding. | 121 // omnibox from sliding. |
122 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding; | 122 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding; |
123 | 123 |
124 // Exposed for testing. | 124 // Exposed for testing. |
125 // Creates a PresentationModeController with the given style. | 125 // Creates a FullscreenToolbarController with the given style. |
126 - (PresentationModeController*)newPresentationModeControllerWithStyle: | 126 - (FullscreenToolbarController*)newFullscreenToolbarControllerWithStyle: |
127 (fullscreen_mac::SlidingStyle)style; | 127 (fullscreen_mac::SlidingStyle)style; |
128 | 128 |
129 // Toggles the AppKit Fullscreen API. By default, doing so enters Canonical | 129 // Toggles the AppKit Fullscreen API. By default, doing so enters Canonical |
130 // Fullscreen. | 130 // Fullscreen. |
131 - (void)enterAppKitFullscreen; | 131 - (void)enterAppKitFullscreen; |
132 - (void)exitAppKitFullscreen; | 132 - (void)exitAppKitFullscreen; |
133 | 133 |
134 // Returns where the fullscreen button should be positioned in the window. | 134 // Returns where the fullscreen button should be positioned in the window. |
135 // Returns NSZeroRect if there is no fullscreen button (if currently in | 135 // Returns NSZeroRect if there is no fullscreen button (if currently in |
136 // fullscreen, or if running 10.6 or 10.10+). | 136 // fullscreen, or if running 10.6 or 10.10+). |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // out of AppKit Fullscreen. | 171 // out of AppKit Fullscreen. |
172 - (BOOL)shouldUseCustomAppKitFullscreenTransition:(BOOL)enterFullScreen; | 172 - (BOOL)shouldUseCustomAppKitFullscreenTransition:(BOOL)enterFullScreen; |
173 | 173 |
174 // Resets the variables that were set from using custom AppKit fullscreen | 174 // Resets the variables that were set from using custom AppKit fullscreen |
175 // animation. | 175 // animation. |
176 - (void)resetCustomAppKitFullscreenVariables; | 176 - (void)resetCustomAppKitFullscreenVariables; |
177 | 177 |
178 - (content::WebContents*)webContents; | 178 - (content::WebContents*)webContents; |
179 - (PermissionBubbleManager*)permissionBubbleManager; | 179 - (PermissionBubbleManager*)permissionBubbleManager; |
180 | 180 |
181 #if defined(MAC_OS_X_VERSION_10_7) && \ | |
182 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 | |
183 // Redeclare some methods from NSWindowDelegate to suppress | |
184 // -Wpartial-availability warnings. | |
185 - (void)windowDidEnterFullScreen:(NSNotification*)notification; | |
186 - (void)windowDidExitFullScreen:(NSNotification*)notification; | |
187 - (void)windowWillExitFullScreen:(NSNotification*)notification; | |
188 | |
189 // Hides or unhides any displayed modal sheet for fullscreen transition. | 181 // Hides or unhides any displayed modal sheet for fullscreen transition. |
190 // Modal sheets should be hidden at the beginning and then shown at the end. | 182 // Modal sheets should be hidden at the beginning and then shown at the end. |
191 - (void)setSheetHiddenForFullscreenTransition:(BOOL)shoudHide; | 183 - (void)setSheetHiddenForFullscreenTransition:(BOOL)shoudHide; |
192 | 184 |
193 // Adjusts the UI and destroys the exit bubble when we are exiting fullscreen. | 185 // Adjusts the UI and destroys the exit bubble when we are exiting fullscreen. |
194 - (void)adjustUIForExitingFullscreen; | 186 - (void)adjustUIForExitingFullscreen; |
195 | 187 |
196 // Determines the appropriate sliding fullscreen style and adjusts the UI to | 188 // Determines the appropriate sliding fullscreen style and adjusts the UI to |
197 // it when we are entering fullscreen. | 189 // it when we are entering fullscreen. |
198 - (void)adjustUIForEnteringFullscreen; | 190 - (void)adjustUIForEnteringFullscreen; |
199 | 191 |
200 // Returns YES if the fullscreen is for tab content or an extension. | 192 // Returns YES if the fullscreen is for tab content or an extension. |
201 - (BOOL)isFullscreenForTabContentOrExtension; | 193 - (BOOL)isFullscreenForTabContentOrExtension; |
202 | 194 |
203 #endif | |
204 | |
205 @end // @interface BrowserWindowController(Private) | 195 @end // @interface BrowserWindowController(Private) |
206 | 196 |
207 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 197 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ |
OLD | NEW |