64ba8feb93
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org>
35 lines
1.6 KiB
Diff
35 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Thu, 4 Oct 2018 14:57:02 -0700
|
|
Subject: fix: also propagate fullscreen state for outer frame
|
|
|
|
When entering fullscreen with Element.requestFullscreen in child frames,
|
|
the parent frame should also enter fullscreen mode too. Chromium handles
|
|
this for iframes, but not for webviews as they are essentially main
|
|
frames instead of child frames.
|
|
|
|
This patch makes webviews propagate the fullscreen state to embedder.
|
|
|
|
Note that we also need to manually update embedder's
|
|
`api::WebContents::IsFullscreenForTabOrPending` value.
|
|
|
|
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
|
index 8b5e24a52b3c89c29440406472b52224d83a015e..a9cf0c88c08d825490f3f03429aa01c021b675ca 100644
|
|
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
|
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
|
@@ -5669,6 +5669,15 @@ void RenderFrameHostImpl::EnterFullscreen(
|
|
notified_instances.insert(parent_site_instance);
|
|
}
|
|
|
|
+ // Entering fullscreen from webview should also notify its outer frame.
|
|
+ if (frame_tree_node()->render_manager()->IsMainFrameForInnerDelegate()) {
|
|
+ RenderFrameProxyHost* outer_proxy =
|
|
+ frame_tree_node()->render_manager()->GetProxyToOuterDelegate();
|
|
+ DCHECK(outer_proxy);
|
|
+ outer_proxy->GetAssociatedRemoteFrame()->WillEnterFullscreen(
|
|
+ options.Clone());
|
|
+ }
|
|
+
|
|
delegate_->EnterFullscreenMode(this, *options);
|
|
delegate_->FullscreenStateChanged(this, true /* is_fullscreen */,
|
|
std::move(options));
|