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 20 matching lines...) Expand all Loading... |
31 // implications for how the contents of the tab render (eg: a video element may | 31 // implications for how the contents of the tab render (eg: a video element may |
32 // grow to consume the whole tab), whereas browser fullscreen mode doesn't. | 32 // grow to consume the whole tab), whereas browser fullscreen mode doesn't. |
33 // Therefore if a user forces an exit from tab fullscreen, we need to notify the | 33 // Therefore if a user forces an exit from tab fullscreen, we need to notify the |
34 // tab so it can stop rendering in its fullscreen mode. | 34 // tab so it can stop rendering in its fullscreen mode. |
35 // | 35 // |
36 // For Flash, FullscreenController will auto-accept all permission requests for | 36 // For Flash, FullscreenController will auto-accept all permission requests for |
37 // fullscreen and/or mouse lock, since the assumption is that the plugin handles | 37 // fullscreen and/or mouse lock, since the assumption is that the plugin handles |
38 // this for us. | 38 // this for us. |
39 // | 39 // |
40 // FullscreenWithinTab Note: | 40 // FullscreenWithinTab Note: |
41 // When the browser is configured as such, all fullscreen widgets are displayed | 41 // All fullscreen widgets are displayed within the tab contents area, and |
42 // within the tab contents area, and FullscreenController will expand the | 42 // FullscreenController will expand the browser window so that the tab contents |
43 // browser window so that the tab contents area fills the entire | 43 // area fills the entire screen. However, special behavior applies when a tab is |
44 // screen. However, special behavior applies when a tab is being | 44 // being screen-captured. First, the browser window will not be |
45 // screen-captured. First, the browser window will not be fullscreened. This | 45 // fullscreened. This allows the user to retain control of their desktop to work |
46 // allows the user to retain control of their desktop to work in other browser | 46 // in other browser tabs or applications while the fullscreen view is displayed |
47 // tabs or applications while the fullscreen view is displayed on a remote | 47 // on a remote screen. Second, FullscreenController will auto-resize fullscreen |
48 // screen. Second, FullscreenController will auto-resize fullscreen widgets to | 48 // widgets to that of the capture video resolution when they are hidden (e.g., |
49 // that of the capture video resolution when they are hidden (e.g., when a user | 49 // when a user has switched to another tab). This is both a performance and |
50 // has switched to another tab). This is both a performance and quality | 50 // quality improvement since scaling and letterboxing steps can be skipped in |
51 // improvement since scaling and letterboxing steps can be skipped in the | 51 // the capture pipeline. |
52 // capture pipeline. | |
53 | 52 |
54 // This class implements fullscreen and mouselock behaviour. | 53 // This class implements fullscreen and mouselock behaviour. |
55 class FullscreenController : public content::NotificationObserver { | 54 class FullscreenController : public content::NotificationObserver { |
56 public: | 55 public: |
57 explicit FullscreenController(Browser* browser); | 56 explicit FullscreenController(Browser* browser); |
58 virtual ~FullscreenController(); | 57 virtual ~FullscreenController(); |
59 | 58 |
60 // Browser/User Fullscreen /////////////////////////////////////////////////// | 59 // Browser/User Fullscreen /////////////////////////////////////////////////// |
61 | 60 |
62 // Returns true if the window is currently fullscreen and was initially | 61 // Returns true if the window is currently fullscreen and was initially |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 193 |
195 // Make the current tab exit fullscreen mode or mouse lock if it is in it. | 194 // Make the current tab exit fullscreen mode or mouse lock if it is in it. |
196 void ExitTabFullscreenOrMouseLockIfNecessary(); | 195 void ExitTabFullscreenOrMouseLockIfNecessary(); |
197 void UpdateFullscreenExitBubbleContent(); | 196 void UpdateFullscreenExitBubbleContent(); |
198 | 197 |
199 ContentSetting GetFullscreenSetting(const GURL& url) const; | 198 ContentSetting GetFullscreenSetting(const GURL& url) const; |
200 ContentSetting GetMouseLockSetting(const GURL& url) const; | 199 ContentSetting GetMouseLockSetting(const GURL& url) const; |
201 | 200 |
202 bool IsPrivilegedFullscreenForTab() const; | 201 bool IsPrivilegedFullscreenForTab() const; |
203 void SetPrivilegedFullscreenForTesting(bool is_privileged); | 202 void SetPrivilegedFullscreenForTesting(bool is_privileged); |
204 // Returns true if fullscreen-within-tab has been enabled for the | |
205 // |browser_|. See 'FullscreenWithinTab Note'. | |
206 bool IsFullscreenWithinTabPossible() const; | |
207 // Returns true if |web_contents| was toggled into/out of fullscreen mode as a | 203 // Returns true if |web_contents| was toggled into/out of fullscreen mode as a |
208 // screen-captured tab. See 'FullscreenWithinTab Note'. | 204 // screen-captured tab. See 'FullscreenWithinTab Note'. |
209 bool MaybeToggleFullscreenForCapturedTab(content::WebContents* web_contents, | 205 bool MaybeToggleFullscreenForCapturedTab(content::WebContents* web_contents, |
210 bool enter_fullscreen); | 206 bool enter_fullscreen); |
211 // Returns true if |web_contents| is in fullscreen mode as a screen-captured | 207 // Returns true if |web_contents| is in fullscreen mode as a screen-captured |
212 // tab. See 'FullscreenWithinTab Note'. | 208 // tab. See 'FullscreenWithinTab Note'. |
213 bool IsFullscreenForCapturedTab(const content::WebContents* web_contents) | 209 bool IsFullscreenForCapturedTab(const content::WebContents* web_contents) |
214 const; | 210 const; |
215 void UnlockMouse(); | 211 void UnlockMouse(); |
216 | 212 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // Used in testing to confirm proper behavior for specific, privileged | 255 // Used in testing to confirm proper behavior for specific, privileged |
260 // fullscreen cases. | 256 // fullscreen cases. |
261 bool is_privileged_fullscreen_for_testing_; | 257 bool is_privileged_fullscreen_for_testing_; |
262 | 258 |
263 base::WeakPtrFactory<FullscreenController> ptr_factory_; | 259 base::WeakPtrFactory<FullscreenController> ptr_factory_; |
264 | 260 |
265 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 261 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
266 }; | 262 }; |
267 | 263 |
268 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 264 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
OLD | NEW |