Chromium Code Reviews| 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 b22bfdaa29fea8982f715fce1d99644b77d2ee72..2ffba63b66a28db1fc297382c5319be99d307398 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -4674,6 +4674,14 @@ void WebContentsImpl::SetAsFocusedWebContentsIfNecessary() { |
| // and focus this contents to activate it. |
| if (old_contents) |
| old_contents->GetMainFrame()->GetRenderWidgetHost()->SetPageFocus(false); |
| + |
| + // Make sure the outer web contents knows our frame is focused. Otherwise, the |
| + // outer renderer could have the element before or after the frame element |
| + // focused which would return early without actually advancing focus. |
| + if (GetRenderManager()->GetProxyToOuterDelegate()) { |
|
alexmos
2016/11/28 23:52:24
nit: { not necessary
avallee
2016/12/09 21:16:51
Done.
|
| + GetRenderManager()->GetProxyToOuterDelegate()->SetFocusedFrame(); |
| + } |
| + |
| GetMainFrame()->GetRenderWidgetHost()->SetPageFocus(true); |
| GetOutermostWebContents()->node_->SetFocusedWebContents(this); |
| } |