| OLD | NEW |
| 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, | 889 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, |
| 890 scope, frame_name, frame_unique_name, sandbox_flags, | 890 scope, frame_name, frame_unique_name, sandbox_flags, |
| 891 frame_owner_properties); | 891 frame_owner_properties); |
| 892 } | 892 } |
| 893 | 893 |
| 894 void RenderFrameHostImpl::OnDetach() { | 894 void RenderFrameHostImpl::OnDetach() { |
| 895 frame_tree_->RemoveFrame(frame_tree_node_); | 895 frame_tree_->RemoveFrame(frame_tree_node_); |
| 896 } | 896 } |
| 897 | 897 |
| 898 void RenderFrameHostImpl::OnFrameFocused() { | 898 void RenderFrameHostImpl::OnFrameFocused() { |
| 899 frame_tree_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); | 899 delegate_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); |
| 900 } | 900 } |
| 901 | 901 |
| 902 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { | 902 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { |
| 903 if (params.is_history_navigation_in_new_child) { | 903 if (params.is_history_navigation_in_new_child) { |
| 904 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); | 904 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); |
| 905 | 905 |
| 906 // Try to find a FrameNavigationEntry that matches this frame instead, based | 906 // Try to find a FrameNavigationEntry that matches this frame instead, based |
| 907 // on the frame's unique name. If this can't be found, fall back to the | 907 // on the frame's unique name. If this can't be found, fall back to the |
| 908 // default params using OpenURL below. | 908 // default params using OpenURL below. |
| 909 if (frame_tree_node_->navigator()->NavigateNewChildFrame( | 909 if (frame_tree_node_->navigator()->NavigateNewChildFrame( |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2235 | 2235 |
| 2236 int opener_routing_id = | 2236 int opener_routing_id = |
| 2237 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance()); | 2237 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance()); |
| 2238 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id)); | 2238 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id)); |
| 2239 } | 2239 } |
| 2240 | 2240 |
| 2241 void RenderFrameHostImpl::SetFocusedFrame() { | 2241 void RenderFrameHostImpl::SetFocusedFrame() { |
| 2242 Send(new FrameMsg_SetFocusedFrame(routing_id_)); | 2242 Send(new FrameMsg_SetFocusedFrame(routing_id_)); |
| 2243 } | 2243 } |
| 2244 | 2244 |
| 2245 void RenderFrameHostImpl::ClearFocusedFrame() { |
| 2246 Send(new FrameMsg_ClearFocusedFrame(routing_id_)); |
| 2247 } |
| 2248 |
| 2245 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before, | 2249 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before, |
| 2246 size_t after) { | 2250 size_t after) { |
| 2247 Send(new InputMsg_ExtendSelectionAndDelete(routing_id_, before, after)); | 2251 Send(new InputMsg_ExtendSelectionAndDelete(routing_id_, before, after)); |
| 2248 } | 2252 } |
| 2249 | 2253 |
| 2250 void RenderFrameHostImpl::JavaScriptDialogClosed( | 2254 void RenderFrameHostImpl::JavaScriptDialogClosed( |
| 2251 IPC::Message* reply_msg, | 2255 IPC::Message* reply_msg, |
| 2252 bool success, | 2256 bool success, |
| 2253 const base::string16& user_input, | 2257 const base::string16& user_input, |
| 2254 bool dialog_was_suppressed) { | 2258 bool dialog_was_suppressed) { |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2832 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2836 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2833 | 2837 |
| 2834 if (browser_plugin_embedder_ax_tree_id_ != AXTreeIDRegistry::kNoAXTreeID) | 2838 if (browser_plugin_embedder_ax_tree_id_ != AXTreeIDRegistry::kNoAXTreeID) |
| 2835 dst->parent_tree_id = browser_plugin_embedder_ax_tree_id_; | 2839 dst->parent_tree_id = browser_plugin_embedder_ax_tree_id_; |
| 2836 | 2840 |
| 2837 // If this is not the root frame tree node, we're done. | 2841 // If this is not the root frame tree node, we're done. |
| 2838 if (frame_tree_node()->parent()) | 2842 if (frame_tree_node()->parent()) |
| 2839 return; | 2843 return; |
| 2840 | 2844 |
| 2841 // For the root frame tree node, also store the AXTreeID of the focused frame. | 2845 // For the root frame tree node, also store the AXTreeID of the focused frame. |
| 2846 // TODO(avallee): https://crbug.com/610795: No focus ax events. |
| 2847 // This is probably where we need to fix the bug to enable the test. |
| 2842 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); | 2848 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); |
| 2843 if (!focused_frame_tree_node) | 2849 if (!focused_frame_tree_node) |
| 2844 return; | 2850 return; |
| 2845 RenderFrameHostImpl* focused_frame = | 2851 RenderFrameHostImpl* focused_frame = |
| 2846 focused_frame_tree_node->current_frame_host(); | 2852 focused_frame_tree_node->current_frame_host(); |
| 2847 DCHECK(focused_frame); | 2853 DCHECK(focused_frame); |
| 2848 dst->focused_tree_id = focused_frame->GetAXTreeID(); | 2854 dst->focused_tree_id = focused_frame->GetAXTreeID(); |
| 2849 } | 2855 } |
| 2850 | 2856 |
| 2851 void RenderFrameHostImpl::CreateWebBluetoothService( | 2857 void RenderFrameHostImpl::CreateWebBluetoothService( |
| 2852 blink::mojom::WebBluetoothServiceRequest request) { | 2858 blink::mojom::WebBluetoothServiceRequest request) { |
| 2853 DCHECK(!web_bluetooth_service_); | 2859 DCHECK(!web_bluetooth_service_); |
| 2854 web_bluetooth_service_.reset( | 2860 web_bluetooth_service_.reset( |
| 2855 new WebBluetoothServiceImpl(this, std::move(request))); | 2861 new WebBluetoothServiceImpl(this, std::move(request))); |
| 2856 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the | 2862 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the |
| 2857 // binding_ which may run the error handler. binding_ can't run the error | 2863 // binding_ which may run the error handler. binding_ can't run the error |
| 2858 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 2864 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
| 2859 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 2865 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 2860 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 2866 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 2861 } | 2867 } |
| 2862 | 2868 |
| 2863 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 2869 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 2864 web_bluetooth_service_.reset(); | 2870 web_bluetooth_service_.reset(); |
| 2865 } | 2871 } |
| 2866 | 2872 |
| 2867 } // namespace content | 2873 } // namespace content |
| OLD | NEW |