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

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

Issue 2715213009: Re-enable FocusBeforeNavigation test. (Closed)
Patch Set: Created 3 years, 10 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
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 232504b30c18a519fdeaf99001d086fc1f39f8e9..fdce9648ed1acba35818b3218122321255de78ec 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1451,11 +1451,14 @@ 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_.reset(new WebContentsTreeNode());
- node_->ConnectToOuterWebContents(
- this, static_cast<WebContentsImpl*>(outer_web_contents),
- static_cast<RenderFrameHostImpl*>(outer_contents_frame));
+ node_->ConnectToOuterWebContents(this, outer_web_contents_impl,
+ outer_contents_frame_impl);
DCHECK(outer_contents_frame);
@@ -1463,8 +1466,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());
@@ -1473,6 +1475,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);
alexmos 2017/03/04 01:12:16 I'm curious if this makes the code that returns th
avallee 2017/03/15 02:55:20 This will end up calling focus on the widget which
+ }
+
// Set up the the guest's AX tree to point back at the embedder's AX tree.
auto* parent_frame = outer_contents_frame->GetParent();
GetMainFrame()->set_browser_plugin_embedder_ax_tree_id(

Powered by Google App Engine
This is Rietveld 408576698