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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "content/browser/bad_message.h" | 8 #include "content/browser/bad_message.h" |
| 9 #include "content/browser/frame_host/cross_process_frame_connector.h" | 9 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 if (cross_process_frame_connector_.get() && | 139 if (cross_process_frame_connector_.get() && |
| 140 cross_process_frame_connector_->OnMessageReceived(msg)) | 140 cross_process_frame_connector_->OnMessageReceived(msg)) |
| 141 return true; | 141 return true; |
| 142 | 142 |
| 143 bool handled = true; | 143 bool handled = true; |
| 144 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxyHost, msg) | 144 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxyHost, msg) |
| 145 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) | 145 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) |
| 146 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) | 146 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) |
| 147 IPC_MESSAGE_HANDLER(FrameHostMsg_RouteMessageEvent, OnRouteMessageEvent) | 147 IPC_MESSAGE_HANDLER(FrameHostMsg_RouteMessageEvent, OnRouteMessageEvent) |
| 148 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener) | 148 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener) |
| 149 IPC_MESSAGE_HANDLER(FrameHostMsg_AdvanceFocus, OnAdvanceFocus) | |
| 149 IPC_MESSAGE_UNHANDLED(handled = false) | 150 IPC_MESSAGE_UNHANDLED(handled = false) |
| 150 IPC_END_MESSAGE_MAP() | 151 IPC_END_MESSAGE_MAP() |
| 151 return handled; | 152 return handled; |
| 152 } | 153 } |
| 153 | 154 |
| 154 bool RenderFrameProxyHost::InitRenderFrameProxy() { | 155 bool RenderFrameProxyHost::InitRenderFrameProxy() { |
| 155 DCHECK(!render_frame_proxy_created_); | 156 DCHECK(!render_frame_proxy_created_); |
| 156 | 157 |
| 157 // It is possible to reach this when the process is dead (in particular, when | 158 // It is possible to reach this when the process is dead (in particular, when |
| 158 // creating proxies from CreateProxiesForChildFrame). In that case, don't | 159 // creating proxies from CreateProxiesForChildFrame). In that case, don't |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 target_rfh->Send( | 319 target_rfh->Send( |
| 319 new FrameMsg_PostMessageEvent(target_rfh->GetRoutingID(), new_params)); | 320 new FrameMsg_PostMessageEvent(target_rfh->GetRoutingID(), new_params)); |
| 320 } | 321 } |
| 321 } | 322 } |
| 322 | 323 |
| 323 void RenderFrameProxyHost::OnDidChangeOpener(int32 opener_routing_id) { | 324 void RenderFrameProxyHost::OnDidChangeOpener(int32 opener_routing_id) { |
| 324 frame_tree_node_->render_manager()->DidChangeOpener(opener_routing_id, | 325 frame_tree_node_->render_manager()->DidChangeOpener(opener_routing_id, |
| 325 GetSiteInstance()); | 326 GetSiteInstance()); |
| 326 } | 327 } |
| 327 | 328 |
| 329 void RenderFrameProxyHost::OnAdvanceFocus(blink::WebFocusType type, | |
| 330 int32 source_routing_id) { | |
|
dcheng
2015/12/04 23:11:01
Nit: int32_t
alexmos
2015/12/05 00:07:45
Done.
| |
| 331 RenderFrameHostImpl* target_rfh = | |
| 332 frame_tree_node_->render_manager()->current_frame_host(); | |
| 333 | |
| 334 RenderFrameHostImpl* source_rfh = | |
|
Charlie Reis
2015/12/04 21:44:50
nit: Add comment:
Translate the source RenderFrame
alexmos
2015/12/04 22:21:17
Done.
| |
| 335 RenderFrameHostImpl::FromID(GetProcess()->GetID(), source_routing_id); | |
| 336 int source_proxy_routing_id = MSG_ROUTING_NONE; | |
| 337 if (source_rfh) { | |
| 338 RenderFrameProxyHost* source_proxy = | |
| 339 source_rfh->frame_tree_node() | |
| 340 ->render_manager() | |
| 341 ->GetRenderFrameProxyHost(target_rfh->GetSiteInstance()); | |
| 342 if (source_proxy) | |
| 343 source_proxy_routing_id = source_proxy->GetRoutingID(); | |
| 344 } | |
| 345 | |
| 346 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type, | |
| 347 source_proxy_routing_id)); | |
| 348 } | |
| 349 | |
| 328 } // namespace content | 350 } // namespace content |
| OLD | NEW |