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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1914643005: Add support for entering/exiting HTML fullscreen from OOPIFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (and deal with gfx:: -> display:: rename). Add replication CL as dependent and use its allowfullscreen test file. Created 4 years, 7 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: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index dbce5b06b65f7e4ff4ef9e4783670e765bcfada8..70fd87996f31152293f601ed2e16c5978a4ec75a 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -146,6 +146,7 @@
#include "public/web/WebPlugin.h"
#include "public/web/WebPluginAction.h"
#include "public/web/WebRange.h"
+#include "public/web/WebScopedUserGesture.h"
#include "public/web/WebSelection.h"
#include "public/web/WebTextInputInfo.h"
#include "public/web/WebViewClient.h"
@@ -1941,6 +1942,37 @@ void WebViewImpl::resize(const WebSize& newSize)
newSize, topControls().height(), topControls().shrinkViewport());
}
+void WebViewImpl::willEnterFullScreen(WebRemoteFrame* fullscreenFrame)
+{
+ FrameOwner* owner = toWebRemoteFrameImpl(fullscreenFrame)->frame()->owner();
+ HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner);
+
+ // Let FullscreenController know that |ownerElement| is an ancestor of the
+ // actual fullscreen element, so that it can be treated a little
+ // differently:
+ // - it will need :-webkit-full-screen-ancestor style in addition to
+ // :-webkit-full-screen.
+ // - it does not need to resend the ToggleFullscreen IPC to the browser
+ // process.
+ m_fullscreenController->setFullscreenIsForCrossProcessAncestor();
dcheng 2016/05/18 01:04:35 So I'm curious if we need to actually do this: can
alexmos 2016/05/18 15:08:33 See my comment above - the reason is that you can
+
+ // Call requestFullScreen() on |ownerElement| to make it the provisional
+ // fullscreen element in FullscreenController, and to prepare
+ // fullscreenchange events that will need to fire on it and its (local)
+ // ancestors. The events will be triggered if/when fullscreen is entered.
+ // Note that requestFullscreen() requires a user gesture.
+ //
+ // TODO(alexmos): currently, WebElement::requestFullScreen assumes prefixed
+ // requests, but in the future, this should plumb in information about
+ // which request type (prefixed or unprefixed) to use for firing fullscreen
+ // events.
+ {
+ WebElement element(ownerElement);
+ WebScopedUserGesture userGesture;
+ element.requestFullScreen();
+ }
+}
+
void WebViewImpl::didEnterFullScreen()
{
m_fullscreenController->didEnterFullScreen();
@@ -1951,6 +1983,11 @@ void WebViewImpl::didExitFullScreen()
m_fullscreenController->didExitFullScreen();
}
+void WebViewImpl::didUpdateFullScreenSize()
+{
+ m_fullscreenController->updateSize();
+}
+
void WebViewImpl::beginFrame(double lastFrameTimeMonotonic)
{
TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeMonotonic);

Powered by Google App Engine
This is Rietveld 408576698