From 7b0bb931b19cb192b1a0cb1838e639a4ad9fb6e3 Mon Sep 17 00:00:00 2001 From: Shezan Baig Date: Mon, 24 Jan 2022 16:13:32 +0000 Subject: [PATCH] Fix notification for focused frame (fixes issue #3248) --- patch/patches/web_contents_1257_1565.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index 809cdf3d5..3ba91e553 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,5 +1,5 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index a3ff7b5dece60..f524e08b1ff08 100644 +index a3ff7b5dece60..4905203885513 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc @@ -2971,6 +2971,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { @@ -39,15 +39,16 @@ index a3ff7b5dece60..f524e08b1ff08 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -7672,6 +7688,8 @@ void WebContentsImpl::OnAdvanceFocus(RenderFrameHostImpl* source_rfh) { - GetFocusedWebContents() == GetOuterWebContents()) { - SetAsFocusedWebContentsIfNecessary(); +@@ -7621,6 +7637,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, + // frames). + SetFocusedFrameTree(node->frame_tree()); } + -+ observers_.NotifyObservers(&WebContentsObserver::OnFrameFocused, source_rfh); ++ observers_.NotifyObservers(&WebContentsObserver::OnFrameFocused, ++ node->current_frame_host()); } - void WebContentsImpl::OnFocusedElementChangedInFrame( + void WebContentsImpl::DidCallFocus() { diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h index 6d1587c1d7e36..a998ec5a27543 100644 --- content/public/browser/web_contents.h