Chromium Code Reviews| Index: content/browser/frame_host/frame_tree.cc |
| diff --git a/content/browser/frame_host/frame_tree.cc b/content/browser/frame_host/frame_tree.cc |
| index ac61afa5240b7d354ad2e4f6b558483f6fb19930..91a5c18d86a15a6bc0db3d2425fad6c6ea216275 100644 |
| --- a/content/browser/frame_host/frame_tree.cc |
| +++ b/content/browser/frame_host/frame_tree.cc |
| @@ -429,12 +429,19 @@ void FrameTree::ReplicatePageFocus(bool is_focused) { |
| // about proxies in SiteInstances for frames in a different FrameTree (e.g., |
| // for window.open), so we can't just iterate over its proxy_hosts_ in |
| // RenderFrameHostManager. |
| - for (const auto& instance : frame_tree_site_instances) { |
| - if (instance == root_->current_frame_host()->GetSiteInstance()) |
| - continue; |
| + for (const auto& instance : frame_tree_site_instances) |
| + SetPageFocus(instance, is_focused); |
| +} |
| + |
| +void FrameTree::SetPageFocus(SiteInstance* instance, bool is_focused) { |
| + RenderFrameHostManager* root_manager = root_->render_manager(); |
| + // Currently, this is only used to set page-level focus in cross-process |
|
Charlie Reis
2015/10/23 21:41:52
nit: Drop "Currently"
alexmos
2015/10/24 00:41:43
Done.
|
| + // subframes, and requests to set focus in main frame's SiteInstance are |
| + // ignored. |
| + if (instance != root_manager->current_frame_host()->GetSiteInstance()) { |
| RenderFrameProxyHost* proxy = |
| - root_->render_manager()->GetRenderFrameProxyHost(instance); |
| + root_manager->GetRenderFrameProxyHost(instance); |
| proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); |
| } |
| } |