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

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

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Fix tab focus change. Created 4 years, 7 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, 852 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id,
853 scope, frame_name, frame_unique_name, sandbox_flags, 853 scope, frame_name, frame_unique_name, sandbox_flags,
854 frame_owner_properties); 854 frame_owner_properties);
855 } 855 }
856 856
857 void RenderFrameHostImpl::OnDetach() { 857 void RenderFrameHostImpl::OnDetach() {
858 frame_tree_->RemoveFrame(frame_tree_node_); 858 frame_tree_->RemoveFrame(frame_tree_node_);
859 } 859 }
860 860
861 void RenderFrameHostImpl::OnFrameFocused() { 861 void RenderFrameHostImpl::OnFrameFocused() {
862 frame_tree_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); 862 delegate_->SetFocusedFrame(frame_tree_node_, GetSiteInstance());
863 } 863 }
864 864
865 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { 865 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) {
866 if (params.is_history_navigation_in_new_child) { 866 if (params.is_history_navigation_in_new_child) {
867 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); 867 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries());
868 868
869 // Try to find a FrameNavigationEntry that matches this frame instead, based 869 // Try to find a FrameNavigationEntry that matches this frame instead, based
870 // on the frame's unique name. If this can't be found, fall back to the 870 // on the frame's unique name. If this can't be found, fall back to the
871 // default params using OpenURL below. 871 // default params using OpenURL below.
872 if (frame_tree_node_->navigator()->NavigateNewChildFrame( 872 if (frame_tree_node_->navigator()->NavigateNewChildFrame(
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2139 2139
2140 int opener_routing_id = 2140 int opener_routing_id =
2141 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance()); 2141 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance());
2142 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id)); 2142 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id));
2143 } 2143 }
2144 2144
2145 void RenderFrameHostImpl::SetFocusedFrame() { 2145 void RenderFrameHostImpl::SetFocusedFrame() {
2146 Send(new FrameMsg_SetFocusedFrame(routing_id_)); 2146 Send(new FrameMsg_SetFocusedFrame(routing_id_));
2147 } 2147 }
2148 2148
2149 void RenderFrameHostImpl::UnsetFocusedFrame() {
alexmos 2016/05/12 20:28:40 nit: naming this (and related bits) ClearFocusedFr
avallee 2016/05/16 20:26:43 Done.
2150 Send(new FrameMsg_UnsetFocusedFrame(routing_id_));
2151 }
2152
2149 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before, 2153 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before,
2150 size_t after) { 2154 size_t after) {
2151 Send(new InputMsg_ExtendSelectionAndDelete(routing_id_, before, after)); 2155 Send(new InputMsg_ExtendSelectionAndDelete(routing_id_, before, after));
2152 } 2156 }
2153 2157
2154 void RenderFrameHostImpl::JavaScriptDialogClosed( 2158 void RenderFrameHostImpl::JavaScriptDialogClosed(
2155 IPC::Message* reply_msg, 2159 IPC::Message* reply_msg,
2156 bool success, 2160 bool success,
2157 const base::string16& user_input, 2161 const base::string16& user_input,
2158 bool dialog_was_suppressed) { 2162 bool dialog_was_suppressed) {
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2741 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2738 2742
2739 if (browser_plugin_embedder_ax_tree_id_ != AXTreeIDRegistry::kNoAXTreeID) 2743 if (browser_plugin_embedder_ax_tree_id_ != AXTreeIDRegistry::kNoAXTreeID)
2740 dst->parent_tree_id = browser_plugin_embedder_ax_tree_id_; 2744 dst->parent_tree_id = browser_plugin_embedder_ax_tree_id_;
2741 2745
2742 // If this is not the root frame tree node, we're done. 2746 // If this is not the root frame tree node, we're done.
2743 if (frame_tree_node()->parent()) 2747 if (frame_tree_node()->parent())
2744 return; 2748 return;
2745 2749
2746 // For the root frame tree node, also store the AXTreeID of the focused frame. 2750 // For the root frame tree node, also store the AXTreeID of the focused frame.
2751 // TODO(avallee): https://crbug.com/610795 This is probably where we need to
2752 // fix the bug to enable the test.
alexmos 2016/05/12 20:28:39 nit: explicitly mention that this code is problema
avallee 2016/05/16 20:26:43 Done.
2747 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); 2753 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame();
2748 if (!focused_frame_tree_node) 2754 if (!focused_frame_tree_node)
2749 return; 2755 return;
2750 RenderFrameHostImpl* focused_frame = 2756 RenderFrameHostImpl* focused_frame =
2751 focused_frame_tree_node->current_frame_host(); 2757 focused_frame_tree_node->current_frame_host();
2752 DCHECK(focused_frame); 2758 DCHECK(focused_frame);
2753 dst->focused_tree_id = focused_frame->GetAXTreeID(); 2759 dst->focused_tree_id = focused_frame->GetAXTreeID();
2754 } 2760 }
2755 2761
2756 void RenderFrameHostImpl::CreateWebBluetoothService( 2762 void RenderFrameHostImpl::CreateWebBluetoothService(
2757 blink::mojom::WebBluetoothServiceRequest request) { 2763 blink::mojom::WebBluetoothServiceRequest request) {
2758 DCHECK(!web_bluetooth_service_); 2764 DCHECK(!web_bluetooth_service_);
2759 web_bluetooth_service_.reset( 2765 web_bluetooth_service_.reset(
2760 new WebBluetoothServiceImpl(this, std::move(request))); 2766 new WebBluetoothServiceImpl(this, std::move(request)));
2761 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the 2767 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the
2762 // binding_ which may run the error handler. binding_ can't run the error 2768 // binding_ which may run the error handler. binding_ can't run the error
2763 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2769 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2764 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2770 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2765 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2771 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2766 } 2772 }
2767 2773
2768 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2774 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2769 web_bluetooth_service_.reset(); 2775 web_bluetooth_service_.reset();
2770 } 2776 }
2771 2777
2772 } // namespace content 2778 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698