Chromium Code Reviews| 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_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 const content::WebContents* web_contents) const; | 88 const content::WebContents* web_contents) const; |
| 89 | 89 |
| 90 // True if fullscreen was entered because of tab fullscreen (was not | 90 // True if fullscreen was entered because of tab fullscreen (was not |
| 91 // previously in user-initiated fullscreen). | 91 // previously in user-initiated fullscreen). |
| 92 bool IsFullscreenCausedByTab() const; | 92 bool IsFullscreenCausedByTab() const; |
| 93 | 93 |
| 94 // Enter or leave tab-initiated fullscreen mode. FullscreenController will | 94 // Enter or leave tab-initiated fullscreen mode. FullscreenController will |
| 95 // decide whether to also fullscreen the browser window. See | 95 // decide whether to also fullscreen the browser window. See |
| 96 // 'FullscreenWithinTab Note'. | 96 // 'FullscreenWithinTab Note'. |
| 97 void ToggleFullscreenModeForTab(content::WebContents* web_contents, | 97 void ToggleFullscreenModeForTab(content::WebContents* web_contents, |
| 98 const GURL& origin, | |
|
Charlie Reis
2014/12/10 00:51:21
nit: Document what |origin| means and is used for.
mlamouri (slow - plz ping)
2014/12/10 15:47:02
Done.
| |
| 98 bool enter_fullscreen); | 99 bool enter_fullscreen); |
| 99 | 100 |
| 100 // Platform Fullscreen /////////////////////////////////////////////////////// | 101 // Platform Fullscreen /////////////////////////////////////////////////////// |
| 101 | 102 |
| 102 // Returns whether we are currently in a Metro snap view. | 103 // Returns whether we are currently in a Metro snap view. |
| 103 bool IsInMetroSnapMode(); | 104 bool IsInMetroSnapMode(); |
| 104 | 105 |
| 105 #if defined(OS_WIN) | 106 #if defined(OS_WIN) |
| 106 // API that puts the window into a mode suitable for rendering when Chrome | 107 // API that puts the window into a mode suitable for rendering when Chrome |
| 107 // is rendered in a 20% screen-width Metro snap view on Windows 8. | 108 // is rendered in a 20% screen-width Metro snap view on Windows 8. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 // Sends a NOTIFICATION_FULLSCREEN_CHANGED notification. | 180 // Sends a NOTIFICATION_FULLSCREEN_CHANGED notification. |
| 180 void NotifyFullscreenChange(bool is_fullscreen); | 181 void NotifyFullscreenChange(bool is_fullscreen); |
| 181 // Notifies the tab that it has been forced out of fullscreen and mouse lock | 182 // Notifies the tab that it has been forced out of fullscreen and mouse lock |
| 182 // mode if necessary. | 183 // mode if necessary. |
| 183 void NotifyTabOfExitIfNecessary(); | 184 void NotifyTabOfExitIfNecessary(); |
| 184 void NotifyMouseLockChange(); | 185 void NotifyMouseLockChange(); |
| 185 | 186 |
| 186 void ToggleFullscreenModeInternal(FullscreenInternalOption option); | 187 void ToggleFullscreenModeInternal(FullscreenInternalOption option); |
| 187 void EnterFullscreenModeInternal(FullscreenInternalOption option); | 188 void EnterFullscreenModeInternal(FullscreenInternalOption option); |
| 188 void ExitFullscreenModeInternal(); | 189 void ExitFullscreenModeInternal(); |
| 189 void SetFullscreenedTab(content::WebContents* tab); | 190 void SetFullscreenedTab(content::WebContents* tab, const GURL& origin); |
| 190 void SetMouseLockTab(content::WebContents* tab); | 191 void SetMouseLockTab(content::WebContents* tab); |
| 191 | 192 |
| 192 // Make the current tab exit fullscreen mode or mouse lock if it is in it. | 193 // Make the current tab exit fullscreen mode or mouse lock if it is in it. |
| 193 void ExitTabFullscreenOrMouseLockIfNecessary(); | 194 void ExitTabFullscreenOrMouseLockIfNecessary(); |
| 194 void UpdateFullscreenExitBubbleContent(); | 195 void UpdateFullscreenExitBubbleContent(); |
| 195 | 196 |
| 196 ContentSetting GetFullscreenSetting(const GURL& url) const; | 197 ContentSetting GetFullscreenSetting() const; |
| 197 ContentSetting GetMouseLockSetting(const GURL& url) const; | 198 ContentSetting GetMouseLockSetting(const GURL& url) const; |
| 198 | 199 |
| 199 bool IsPrivilegedFullscreenForTab() const; | 200 bool IsPrivilegedFullscreenForTab() const; |
| 200 void SetPrivilegedFullscreenForTesting(bool is_privileged); | 201 void SetPrivilegedFullscreenForTesting(bool is_privileged); |
| 201 // Returns true if |web_contents| was toggled into/out of fullscreen mode as a | 202 // Returns true if |web_contents| was toggled into/out of fullscreen mode as a |
| 202 // screen-captured tab. See 'FullscreenWithinTab Note'. | 203 // screen-captured tab. See 'FullscreenWithinTab Note'. |
| 203 bool MaybeToggleFullscreenForCapturedTab(content::WebContents* web_contents, | 204 bool MaybeToggleFullscreenForCapturedTab(content::WebContents* web_contents, |
| 204 bool enter_fullscreen); | 205 bool enter_fullscreen); |
| 205 // Returns true if |web_contents| is in fullscreen mode as a screen-captured | 206 // Returns true if |web_contents| is in fullscreen mode as a screen-captured |
| 206 // tab. See 'FullscreenWithinTab Note'. | 207 // tab. See 'FullscreenWithinTab Note'. |
| 207 bool IsFullscreenForCapturedTab(const content::WebContents* web_contents) | 208 bool IsFullscreenForCapturedTab(const content::WebContents* web_contents) |
| 208 const; | 209 const; |
| 209 void UnlockMouse(); | 210 void UnlockMouse(); |
| 210 | 211 |
| 212 // Helper methods that should be used in a TAB context. | |
| 213 GURL GetRequestingOrigin() const; | |
| 214 GURL GetEmbeddingOrigin() const; | |
| 215 | |
| 211 Browser* const browser_; | 216 Browser* const browser_; |
| 212 BrowserWindow* const window_; | 217 BrowserWindow* const window_; |
| 213 Profile* const profile_; | 218 Profile* const profile_; |
| 214 | 219 |
| 215 // If there is currently a tab in fullscreen mode (entered via | 220 // If there is currently a tab in fullscreen mode (entered via |
| 216 // webkitRequestFullScreen), this is its WebContents. | 221 // webkitRequestFullScreen), this is its WebContents. |
| 217 // Assign using SetFullscreenedTab(). | 222 // Assign using SetFullscreenedTab(). |
| 218 content::WebContents* fullscreened_tab_; | 223 content::WebContents* fullscreened_tab_; |
| 219 | 224 |
| 225 // If a tab is fullscreen, the |fullscreen_origin_| should be used as the | |
| 226 // origin with regards to fullscreen. The |fullscreened_tab_| url should be | |
| 227 // used as the embedder url. | |
| 228 GURL fullscreened_origin_; | |
| 229 | |
| 220 // The URL of the extension which trigerred "browser fullscreen" mode. | 230 // The URL of the extension which trigerred "browser fullscreen" mode. |
| 221 GURL extension_caused_fullscreen_; | 231 GURL extension_caused_fullscreen_; |
| 222 | 232 |
| 223 enum PriorFullscreenState { | 233 enum PriorFullscreenState { |
| 224 STATE_INVALID, | 234 STATE_INVALID, |
| 225 STATE_NORMAL, | 235 STATE_NORMAL, |
| 226 STATE_BROWSER_FULLSCREEN_NO_TOOLBAR, | 236 STATE_BROWSER_FULLSCREEN_NO_TOOLBAR, |
| 227 STATE_BROWSER_FULLSCREEN_WITH_TOOLBAR, | 237 STATE_BROWSER_FULLSCREEN_WITH_TOOLBAR, |
| 228 }; | 238 }; |
| 229 // The state before entering tab fullscreen mode via webkitRequestFullScreen. | 239 // The state before entering tab fullscreen mode via webkitRequestFullScreen. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 251 // Used in testing to confirm proper behavior for specific, privileged | 261 // Used in testing to confirm proper behavior for specific, privileged |
| 252 // fullscreen cases. | 262 // fullscreen cases. |
| 253 bool is_privileged_fullscreen_for_testing_; | 263 bool is_privileged_fullscreen_for_testing_; |
| 254 | 264 |
| 255 base::WeakPtrFactory<FullscreenController> ptr_factory_; | 265 base::WeakPtrFactory<FullscreenController> ptr_factory_; |
| 256 | 266 |
| 257 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 267 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
| 258 }; | 268 }; |
| 259 | 269 |
| 260 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 270 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
| OLD | NEW |