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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2715213009: Re-enable FocusBeforeNavigation test. (Closed)
Patch Set: rebase Created 3 years, 8 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 | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e0d64d07eab267edf2e559e905078c3dfda9145c..ab36e7174d8e3e4b9f4ef97aad006d8d714954fa 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1447,10 +1447,13 @@ void WebContentsImpl::AttachToOuterWebContentsFrame(
if (!render_manager->GetRenderWidgetHostView())
CreateRenderWidgetHostViewForRenderManager(GetRenderViewHost());
+ auto* outer_web_contents_impl =
+ static_cast<WebContentsImpl*>(outer_web_contents);
+ auto* outer_contents_frame_impl =
+ static_cast<RenderFrameHostImpl*>(outer_contents_frame);
// Create a link to our outer WebContents.
- node_.ConnectToOuterWebContents(
- static_cast<WebContentsImpl*>(outer_web_contents),
- static_cast<RenderFrameHostImpl*>(outer_contents_frame));
+ node_.ConnectToOuterWebContents(outer_web_contents_impl,
+ outer_contents_frame_impl);
DCHECK(outer_contents_frame);
@@ -1458,8 +1461,7 @@ void WebContentsImpl::AttachToOuterWebContentsFrame(
// SiteInstance of the outer WebContents. The proxy will be used to send
// postMessage to the inner WebContents.
render_manager->CreateOuterDelegateProxy(
- outer_contents_frame->GetSiteInstance(),
- static_cast<RenderFrameHostImpl*>(outer_contents_frame));
+ outer_contents_frame->GetSiteInstance(), outer_contents_frame_impl);
render_manager->SetRWHViewForInnerContents(
render_manager->GetRenderWidgetHostView());
@@ -1468,6 +1470,11 @@ void WebContentsImpl::AttachToOuterWebContentsFrame(
render_manager->GetRenderWidgetHostView())
->RegisterFrameSinkId();
+ if (outer_web_contents_impl->frame_tree_.GetFocusedFrame() ==
+ outer_contents_frame_impl->frame_tree_node()) {
+ SetFocusedFrame(frame_tree_.root(), nullptr);
+ }
+
// At this point, we should destroy the TextInputManager which will notify all
// the RWHV in this WebContents. The RWHV in this WebContents should use the
// TextInputManager owned by the outer WebContents.
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698