2021-07-02 00:56:29 +00:00
|
|
|
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
|
2022-02-25 18:17:35 +00:00
|
|
|
index 713e2883139bca4bb56dcc7e3efcf6d6dfc4a02b..be2721cc6dc0582a05c74ac3d50c123666d7d5a3 100644
|
2021-07-02 00:56:29 +00:00
|
|
|
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
|
|
|
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
2022-02-25 18:17:35 +00:00
|
|
|
@@ -6102,6 +6102,15 @@ void RenderFrameHostImpl::EnterFullscreen(
|
2021-07-02 00:56:29 +00:00
|
|
|
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);
|
2021-09-01 19:55:07 +00:00
|
|
|
delegate_->FullscreenStateChanged(this, /*is_fullscreen=*/true,
|
2021-07-02 00:56:29 +00:00
|
|
|
std::move(options));
|