Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: content/browser/frame_host/render_frame_proxy_host.cc

Issue 1500873002: Implement sequential focus navigation for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Daniel's comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_t source_routing_id) {
331 RenderFrameHostImpl* target_rfh =
332 frame_tree_node_->render_manager()->current_frame_host();
333
334 // Translate the source RenderFrameHost in this process to its equivalent
335 // RenderFrameProxyHost in the target process. This is needed for continuing
336 // the focus traversal from correct place in a parent frame after one of its
337 // child frames finishes its traversal.
338 RenderFrameHostImpl* source_rfh =
339 RenderFrameHostImpl::FromID(GetProcess()->GetID(), source_routing_id);
340 int32_t source_proxy_routing_id = MSG_ROUTING_NONE;
341 if (source_rfh) {
342 RenderFrameProxyHost* source_proxy =
343 source_rfh->frame_tree_node()
344 ->render_manager()
345 ->GetRenderFrameProxyHost(target_rfh->GetSiteInstance());
346 if (source_proxy)
347 source_proxy_routing_id = source_proxy->GetRoutingID();
348 }
349
350 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type,
351 source_proxy_routing_id));
352 }
353
328 } // namespace content 354 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_proxy_host.h ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698