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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/render_frame_proxy_host.cc
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc
index c921e04697adbfb4625e7d50bbb7538cdfc7b791..1f0c1825417965015d9eb7c42d30c38a6e3b8829 100644
--- a/content/browser/frame_host/render_frame_proxy_host.cc
+++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -146,6 +146,7 @@ bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL)
IPC_MESSAGE_HANDLER(FrameHostMsg_RouteMessageEvent, OnRouteMessageEvent)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_AdvanceFocus, OnAdvanceFocus)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -325,4 +326,29 @@ void RenderFrameProxyHost::OnDidChangeOpener(int32 opener_routing_id) {
GetSiteInstance());
}
+void RenderFrameProxyHost::OnAdvanceFocus(blink::WebFocusType type,
+ int32_t source_routing_id) {
+ RenderFrameHostImpl* target_rfh =
+ frame_tree_node_->render_manager()->current_frame_host();
+
+ // Translate the source RenderFrameHost in this process to its equivalent
+ // RenderFrameProxyHost in the target process. This is needed for continuing
+ // the focus traversal from correct place in a parent frame after one of its
+ // child frames finishes its traversal.
+ RenderFrameHostImpl* source_rfh =
+ RenderFrameHostImpl::FromID(GetProcess()->GetID(), source_routing_id);
+ int32_t source_proxy_routing_id = MSG_ROUTING_NONE;
+ if (source_rfh) {
+ RenderFrameProxyHost* source_proxy =
+ source_rfh->frame_tree_node()
+ ->render_manager()
+ ->GetRenderFrameProxyHost(target_rfh->GetSiteInstance());
+ if (source_proxy)
+ source_proxy_routing_id = source_proxy->GetRoutingID();
+ }
+
+ target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type,
+ source_proxy_routing_id));
+}
+
} // namespace content
« 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