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_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // in other browser tabs or applications while the fullscreen view is displayed | 42 // in other browser tabs or applications while the fullscreen view is displayed |
43 // on a remote screen. Second, FullscreenController will auto-resize fullscreen | 43 // on a remote screen. Second, FullscreenController will auto-resize fullscreen |
44 // widgets to that of the capture video resolution when they are hidden (e.g., | 44 // widgets to that of the capture video resolution when they are hidden (e.g., |
45 // when a user has switched to another tab). This is both a performance and | 45 // when a user has switched to another tab). This is both a performance and |
46 // quality improvement since scaling and letterboxing steps can be skipped in | 46 // quality improvement since scaling and letterboxing steps can be skipped in |
47 // the capture pipeline. | 47 // the capture pipeline. |
48 | 48 |
49 // This class implements fullscreen behaviour. | 49 // This class implements fullscreen behaviour. |
50 class FullscreenController : public ExclusiveAccessControllerBase { | 50 class FullscreenController : public ExclusiveAccessControllerBase { |
51 public: | 51 public: |
52 FullscreenController(ExclusiveAccessManager* manager, Browser* browser); | 52 explicit FullscreenController(ExclusiveAccessManager* manager); |
53 ~FullscreenController() override; | 53 ~FullscreenController() override; |
54 | 54 |
55 // Browser/User Fullscreen /////////////////////////////////////////////////// | 55 // Browser/User Fullscreen /////////////////////////////////////////////////// |
56 | 56 |
57 // Returns true if the window is currently fullscreen and was initially | 57 // Returns true if the window is currently fullscreen and was initially |
58 // transitioned to fullscreen by a browser (i.e., not tab-initiated) mode | 58 // transitioned to fullscreen by a browser (i.e., not tab-initiated) mode |
59 // transition. | 59 // transition. |
60 bool IsFullscreenForBrowser() const; | 60 bool IsFullscreenForBrowser() const; |
61 | 61 |
62 // Returns true if Flash is providing the "exit from fullscreen" message. | 62 // Returns true if Flash is providing the "exit from fullscreen" message. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // origin will be used. | 109 // origin will be used. |
110 void EnterFullscreenModeForTab(content::WebContents* web_contents, | 110 void EnterFullscreenModeForTab(content::WebContents* web_contents, |
111 const GURL& origin); | 111 const GURL& origin); |
112 | 112 |
113 // Leave a tab-initiated fullscreen mode. | 113 // Leave a tab-initiated fullscreen mode. |
114 // |web_contents| represents the tab that requests to no longer be fullscreen. | 114 // |web_contents| represents the tab that requests to no longer be fullscreen. |
115 void ExitFullscreenModeForTab(content::WebContents* web_contents); | 115 void ExitFullscreenModeForTab(content::WebContents* web_contents); |
116 | 116 |
117 // Platform Fullscreen /////////////////////////////////////////////////////// | 117 // Platform Fullscreen /////////////////////////////////////////////////////// |
118 | 118 |
| 119 #if defined(OS_WIN) |
119 // Returns whether we are currently in a Metro snap view. | 120 // Returns whether we are currently in a Metro snap view. |
120 bool IsInMetroSnapMode(); | 121 bool IsInMetroSnapMode(); |
121 | 122 |
122 #if defined(OS_WIN) | |
123 // API that puts the window into a mode suitable for rendering when Chrome | 123 // API that puts the window into a mode suitable for rendering when Chrome |
124 // is rendered in a 20% screen-width Metro snap view on Windows 8. | 124 // is rendered in a 20% screen-width Metro snap view on Windows 8. |
125 void SetMetroSnapMode(bool enable); | 125 void SetMetroSnapMode(bool enable); |
126 #endif | 126 #endif // OS_WIN |
127 | 127 |
128 // Overrde from ExclusiveAccessControllerBase. | 128 // Overrde from ExclusiveAccessControllerBase. |
129 void OnTabDetachedFromView(content::WebContents* web_contents) override; | 129 void OnTabDetachedFromView(content::WebContents* web_contents) override; |
130 void OnTabClosing(content::WebContents* web_contents) override; | 130 void OnTabClosing(content::WebContents* web_contents) override; |
131 bool HandleUserPressedEscape() override; | 131 bool HandleUserPressedEscape() override; |
132 | 132 |
133 void ExitExclusiveAccessToPreviousState() override; | 133 void ExitExclusiveAccessToPreviousState() override; |
134 bool OnAcceptExclusiveAccessPermission() override; | 134 bool OnAcceptExclusiveAccessPermission() override; |
135 bool OnDenyExclusiveAccessPermission() override; | 135 bool OnDenyExclusiveAccessPermission() override; |
136 GURL GetURLForExclusiveAccessBubble() const override; | 136 GURL GetURLForExclusiveAccessBubble() const override; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // Used in testing to confirm proper behavior for specific, privileged | 210 // Used in testing to confirm proper behavior for specific, privileged |
211 // fullscreen cases. | 211 // fullscreen cases. |
212 bool is_privileged_fullscreen_for_testing_; | 212 bool is_privileged_fullscreen_for_testing_; |
213 | 213 |
214 base::WeakPtrFactory<FullscreenController> ptr_factory_; | 214 base::WeakPtrFactory<FullscreenController> ptr_factory_; |
215 | 215 |
216 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 216 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
217 }; | 217 }; |
218 | 218 |
219 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_H_ | 219 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_H_ |
OLD | NEW |