Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3285)

Unified Diff: chrome/browser/ui/fullscreen/fullscreen_controller.h

Issue 23477051: Embed Flash Fullscreen widget within browser window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add caution comment to chrome_switches.cc. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/fullscreen/fullscreen_controller.h
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller.h b/chrome/browser/ui/fullscreen/fullscreen_controller.h
index b7ff113c88f0af846a97e876e082fcc20bd59bb3..ae5e20f407dde010226faa266c42226eca4b35be 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller.h
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller.h
@@ -22,14 +22,18 @@ class WebContents;
}
// There are two different kinds of fullscreen mode - "tab fullscreen" and
-// "browser fullscreen". "Tab fullscreen" refers to when a tab enters
-// fullscreen mode via the JS fullscreen API, and "browser fullscreen" refers
-// to the user putting the browser itself into fullscreen mode from the UI. The
-// difference is that tab fullscreen has implications for how the contents of
-// the tab render (eg: a video element may grow to consume the whole tab),
-// whereas browser fullscreen mode doesn't. Therefore if a user forces an exit
-// from tab fullscreen, we need to notify the tab so it can stop rendering in
-// its fullscreen mode.
+// "browser fullscreen". "Tab fullscreen" refers to a renderer-initiated
+// fullscreen mode (eg: from a Flash plugin or via the JS fullscreen API),
+// whereas "browser fullscreen" refers to the user putting the browser itself
+// into fullscreen mode from the UI. The difference is that tab fullscreen has
+// implications for how the contents of the tab render (eg: a video element may
+// grow to consume the whole tab), whereas browser fullscreen mode doesn't.
+// Therefore if a user forces an exit from tab fullscreen, we need to notify the
+// tab so it can stop rendering in its fullscreen mode.
+//
+// For Flash, FullscreenController will auto-accept all permission requests for
+// fullscreen and/or mouse lock, since the assumption is that the plugin handles
+// this for us.
// This class implements fullscreen and mouselock behaviour.
class FullscreenController : public content::NotificationObserver {
@@ -45,7 +49,7 @@ class FullscreenController : public content::NotificationObserver {
void ToggleFullscreenMode();
- // Tab/HTML Fullscreen ///////////////////////////////////////////////////////
+ // Tab/HTML/Flash Fullscreen /////////////////////////////////////////////////
// Returns true if fullscreen has been caused by a tab.
// The window may still be transitioning, and window_->IsFullscreen()
@@ -122,6 +126,8 @@ class FullscreenController : public content::NotificationObserver {
FullscreenExitBubbleType GetFullscreenExitBubbleType() const;
private:
+ friend class FullscreenControllerTest;
+
enum MouseLockState {
MOUSELOCK_NOT_REQUESTED,
// The page requests to lock the mouse and the user hasn't responded to the
@@ -165,11 +171,15 @@ class FullscreenController : public content::NotificationObserver {
ContentSetting GetFullscreenSetting(const GURL& url) const;
ContentSetting GetMouseLockSetting(const GURL& url) const;
+ bool IsPrivilegedFullscreenForTab() const;
+ void SetPrivilegedFullscreenForTesting(bool is_privileged);
+ void UnlockMouse();
+
base::WeakPtrFactory<FullscreenController> ptr_factory_;
- Browser* browser_;
- BrowserWindow* window_;
- Profile* profile_;
+ Browser* const browser_;
+ BrowserWindow* const window_;
+ Profile* const profile_;
// If there is currently a tab in fullscreen mode (entered via
// webkitRequestFullScreen), this is its WebContents.
@@ -209,6 +219,10 @@ class FullscreenController : public content::NotificationObserver {
// WindowFullscreenStateChanged do so.
bool reentrant_window_state_change_call_check_;
+ // Used in testing to confirm proper behavior for specific, privileged
+ // fullscreen cases.
+ bool is_privileged_fullscreen_for_testing_;
+
DISALLOW_COPY_AND_ASSIGN(FullscreenController);
};
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/fullscreen/fullscreen_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698