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
|
2023-04-04 13:42:56 +00:00
|
|
|
index 79336d50231e352f83d3e06f35bacdfac0289f2a..150f03df689d44d627fbe8366bc997a5cdfedba5 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
|
2023-03-31 02:03:58 +00:00
|
|
|
@@ -6911,6 +6911,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
2022-07-20 11:03:34 +00:00
|
|
|
}
|
2021-07-02 00:56:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // 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);
|
2022-07-20 11:03:34 +00:00
|
|
|
+ if (outer_proxy->is_render_frame_proxy_live()) {
|
|
|
|
+ outer_proxy->GetAssociatedRemoteFrame()->WillEnterFullscreen(
|
|
|
|
+ options.Clone());
|
|
|
|
+ }
|
2021-07-02 00:56:29 +00:00
|
|
|
+ }
|
|
|
|
+
|
2022-06-27 20:50:08 +00:00
|
|
|
// Focus the window if another frame may have delegated the capability.
|
|
|
|
if (had_fullscreen_token && !GetView()->HasFocus())
|
|
|
|
GetView()->Focus();
|