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

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

Issue 789533002: Fullscreen: make fullscreen requests come from RenderFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make try happy Created 5 years, 11 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/exclusive_access/fullscreen_controller.h
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.h b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
index 955754ca80eff0109017f8268f1205c151998606..d276678fd6ae79968f76aac3e2c4ce836b687040 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.h
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
@@ -91,11 +91,19 @@ class FullscreenController : public content::NotificationObserver {
// previously in user-initiated fullscreen).
bool IsFullscreenCausedByTab() const;
- // Enter or leave tab-initiated fullscreen mode. FullscreenController will
- // decide whether to also fullscreen the browser window. See
- // 'FullscreenWithinTab Note'.
- void ToggleFullscreenModeForTab(content::WebContents* web_contents,
- bool enter_fullscreen);
+ // Enter tab-initiated fullscreen mode. FullscreenController will decide
+ // whether to also fullscreen the browser window. See 'FullscreenWithinTab
+ // Note'.
+ // |web_contents| represents the tab that requests to be fullscreen.
+ // |origin| represents the origin of the requesting frame inside the
+ // WebContents. If empty, then the |web_contents|'s latest committed URL
+ // origin will be used.
+ void EnterFullscreenModeForTab(content::WebContents* web_contents,
+ const GURL& origin);
+
+ // Leave a tab-initiated fullscreen mode.
+ // |web_contents| represents the tab that requests to no longer be fullscreen.
+ void ExitFullscreenModeForTab(content::WebContents* web_contents);
// Platform Fullscreen ///////////////////////////////////////////////////////
@@ -186,14 +194,14 @@ class FullscreenController : public content::NotificationObserver {
void ToggleFullscreenModeInternal(FullscreenInternalOption option);
void EnterFullscreenModeInternal(FullscreenInternalOption option);
void ExitFullscreenModeInternal();
- void SetFullscreenedTab(content::WebContents* tab);
+ void SetFullscreenedTab(content::WebContents* tab, const GURL& origin);
void SetMouseLockTab(content::WebContents* tab);
// Make the current tab exit fullscreen mode or mouse lock if it is in it.
void ExitTabFullscreenOrMouseLockIfNecessary();
void UpdateFullscreenExitBubbleContent();
- ContentSetting GetFullscreenSetting(const GURL& url) const;
+ ContentSetting GetFullscreenSetting() const;
ContentSetting GetMouseLockSetting(const GURL& url) const;
bool IsPrivilegedFullscreenForTab() const;
@@ -208,6 +216,10 @@ class FullscreenController : public content::NotificationObserver {
const;
void UnlockMouse();
+ // Helper methods that should be used in a TAB context.
+ GURL GetRequestingOrigin() const;
+ GURL GetEmbeddingOrigin() const;
+
Browser* const browser_;
BrowserWindow* const window_;
Profile* const profile_;
@@ -217,6 +229,11 @@ class FullscreenController : public content::NotificationObserver {
// Assign using SetFullscreenedTab().
content::WebContents* fullscreened_tab_;
+ // If a tab is fullscreen, the |fullscreen_origin_| should be used as the
+ // origin with regards to fullscreen. The |fullscreened_tab_| url should be
+ // used as the embedder url.
+ GURL fullscreened_origin_;
+
// The URL of the extension which trigerred "browser fullscreen" mode.
GURL extension_caused_fullscreen_;

Powered by Google App Engine
This is Rietveld 408576698