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

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

Issue 2021513002: Move willEnterFullscreen to WebRemoteFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment about user gestures 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
« no previous file with comments | « third_party/WebKit/Source/web/WebRemoteFrameImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
index 30c95b233a444927b9859f349f167a448c149c11..48bb0c80faad006c0495a2f49e6b3908664b7a54 100644
--- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
@@ -4,6 +4,7 @@
#include "web/WebRemoteFrameImpl.h"
+#include "core/dom/Fullscreen.h"
#include "core/dom/RemoteSecurityContext.h"
#include "core/dom/SecurityContext.h"
#include "core/frame/FrameView.h"
@@ -706,6 +707,29 @@ bool WebRemoteFrameImpl::isIgnoredForHitTest() const
return owner->layoutObject()->style()->pointerEvents() == PE_NONE;
}
+void WebRemoteFrameImpl::willEnterFullScreen()
+{
+ // This should only ever be called when the FrameOwner is local.
+ HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(frame()->owner());
+
+ // 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.
+ //
+ // Passing |forCrossProcessAncestor| to requestFullscreen is necessary
+ // because:
+ // - |ownerElement| will need :-webkit-full-screen-ancestor style in
+ // addition to :-webkit-full-screen.
+ // - there's no need to resend the ToggleFullscreen IPC to the browser
+ // process.
+ //
+ // TODO(alexmos): currently, this 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.
+ Fullscreen::from(ownerElement->document()).requestFullscreen(*ownerElement, Fullscreen::PrefixedRequest, true /* forCrossProcessAncestor */);
+}
+
WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, WebRemoteFrameClient* client)
: WebRemoteFrame(scope)
, m_frameClient(RemoteFrameClientImpl::create(this))
« no previous file with comments | « third_party/WebKit/Source/web/WebRemoteFrameImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698