| Index: content/browser/frame_host/render_frame_host_manager.cc
|
| diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
|
| index de21bd41582cc8213d14c4aab131afa2e2cd0a78..09681354741acc619163c1d09bdaef3757d0e072 100644
|
| --- a/content/browser/frame_host/render_frame_host_manager.cc
|
| +++ b/content/browser/frame_host/render_frame_host_manager.cc
|
| @@ -2173,11 +2173,16 @@ void RenderFrameHostManager::CommitPending() {
|
| "FrameTreeNode id", frame_tree_node_->frame_tree_node_id());
|
| DCHECK(pending_render_frame_host_ || speculative_render_frame_host_);
|
|
|
| + bool is_main_frame = frame_tree_node_->IsMainFrame();
|
| +
|
| // First check whether we're going to want to focus the location bar after
|
| // this commit. We do this now because the navigation hasn't formally
|
| // committed yet, so if we've already cleared the pending WebUI the call chain
|
| - // this triggers won't be able to figure out what's going on.
|
| - bool will_focus_location_bar = delegate_->FocusLocationBarByDefault();
|
| + // this triggers won't be able to figure out what's going on. Note that
|
| + // subframe commits should not be allowed to steal focus from the main frame
|
| + // by focusing the location bar (see https://crbug.com/700124).
|
| + bool will_focus_location_bar =
|
| + is_main_frame && delegate_->FocusLocationBarByDefault();
|
|
|
| // Remember if the page was focused so we can focus the new renderer in
|
| // that case.
|
| @@ -2185,8 +2190,6 @@ void RenderFrameHostManager::CommitPending() {
|
| render_frame_host_->GetView() &&
|
| render_frame_host_->GetView()->HasFocus();
|
|
|
| - bool is_main_frame = frame_tree_node_->IsMainFrame();
|
| -
|
| // While the old frame is still current, remove its children from the tree.
|
| frame_tree_node_->ResetForNewProcess();
|
|
|
|
|