Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/render_frame_proxy_host.h" | 5 #include "content/browser/frame_host/render_frame_proxy_host.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "content/browser/bad_message.h" | 10 #include "content/browser/bad_message.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 int32_t source_routing_id) { | 352 int32_t source_routing_id) { |
| 353 RenderFrameHostImpl* target_rfh = | 353 RenderFrameHostImpl* target_rfh = |
| 354 frame_tree_node_->render_manager()->current_frame_host(); | 354 frame_tree_node_->render_manager()->current_frame_host(); |
| 355 | 355 |
| 356 // Translate the source RenderFrameHost in this process to its equivalent | 356 // Translate the source RenderFrameHost in this process to its equivalent |
| 357 // RenderFrameProxyHost in the target process. This is needed for continuing | 357 // RenderFrameProxyHost in the target process. This is needed for continuing |
| 358 // the focus traversal from correct place in a parent frame after one of its | 358 // the focus traversal from correct place in a parent frame after one of its |
| 359 // child frames finishes its traversal. | 359 // child frames finishes its traversal. |
| 360 RenderFrameHostImpl* source_rfh = | 360 RenderFrameHostImpl* source_rfh = |
| 361 RenderFrameHostImpl::FromID(GetProcess()->GetID(), source_routing_id); | 361 RenderFrameHostImpl::FromID(GetProcess()->GetID(), source_routing_id); |
| 362 int32_t source_proxy_routing_id = MSG_ROUTING_NONE; | 362 target_rfh->AdvanceFocus( |
| 363 if (source_rfh) { | 363 type, (source_rfh |
|
alexmos
2016/11/22 02:45:27
Let's keep source_proxy defined as a separate var
avallee
2016/11/25 19:39:54
Done.
| |
| 364 RenderFrameProxyHost* source_proxy = | 364 ? source_rfh->frame_tree_node() |
| 365 source_rfh->frame_tree_node() | 365 ->render_manager() |
| 366 ->render_manager() | 366 ->GetRenderFrameProxyHost(target_rfh->GetSiteInstance()) |
| 367 ->GetRenderFrameProxyHost(target_rfh->GetSiteInstance()); | 367 : nullptr)); |
| 368 if (source_proxy) | |
| 369 source_proxy_routing_id = source_proxy->GetRoutingID(); | |
| 370 } | |
| 371 | |
| 372 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type, | |
| 373 source_proxy_routing_id)); | |
| 374 } | 368 } |
| 375 | 369 |
| 376 void RenderFrameProxyHost::OnFrameFocused() { | 370 void RenderFrameProxyHost::OnFrameFocused() { |
| 377 frame_tree_node_->current_frame_host()->delegate()->SetFocusedFrame( | 371 frame_tree_node_->current_frame_host()->delegate()->SetFocusedFrame( |
| 378 frame_tree_node_, GetSiteInstance()); | 372 frame_tree_node_, GetSiteInstance()); |
| 379 } | 373 } |
| 380 | 374 |
| 381 void RenderFrameProxyHost::OnSetHasReceivedUserGesture() { | 375 void RenderFrameProxyHost::OnSetHasReceivedUserGesture() { |
| 382 frame_tree_node_->current_frame_host()->SetHasReceivedUserGesture(); | 376 frame_tree_node_->current_frame_host()->SetHasReceivedUserGesture(); |
| 383 } | 377 } |
| 384 | 378 |
| 385 } // namespace content | 379 } // namespace content |
| OLD | NEW |