| 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, | 947 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, |
| 948 scope, frame_name, frame_unique_name, sandbox_flags, | 948 scope, frame_name, frame_unique_name, sandbox_flags, |
| 949 frame_owner_properties); | 949 frame_owner_properties); |
| 950 } | 950 } |
| 951 | 951 |
| 952 void RenderFrameHostImpl::OnDetach() { | 952 void RenderFrameHostImpl::OnDetach() { |
| 953 frame_tree_->RemoveFrame(frame_tree_node_); | 953 frame_tree_->RemoveFrame(frame_tree_node_); |
| 954 } | 954 } |
| 955 | 955 |
| 956 void RenderFrameHostImpl::OnFrameFocused() { | 956 void RenderFrameHostImpl::OnFrameFocused() { |
| 957 frame_tree_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); | 957 delegate_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); |
| 958 } | 958 } |
| 959 | 959 |
| 960 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { | 960 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { |
| 961 if (params.is_history_navigation_in_new_child) { | 961 if (params.is_history_navigation_in_new_child) { |
| 962 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); | 962 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); |
| 963 | 963 |
| 964 // Try to find a FrameNavigationEntry that matches this frame instead, based | 964 // Try to find a FrameNavigationEntry that matches this frame instead, based |
| 965 // on the frame's unique name. If this can't be found, fall back to the | 965 // on the frame's unique name. If this can't be found, fall back to the |
| 966 // default params using OpenURL below. | 966 // default params using OpenURL below. |
| 967 if (frame_tree_node_->navigator()->NavigateNewChildFrame( | 967 if (frame_tree_node_->navigator()->NavigateNewChildFrame( |
| (...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2328 | 2328 |
| 2329 int opener_routing_id = | 2329 int opener_routing_id = |
| 2330 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance()); | 2330 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance()); |
| 2331 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id)); | 2331 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id)); |
| 2332 } | 2332 } |
| 2333 | 2333 |
| 2334 void RenderFrameHostImpl::SetFocusedFrame() { | 2334 void RenderFrameHostImpl::SetFocusedFrame() { |
| 2335 Send(new FrameMsg_SetFocusedFrame(routing_id_)); | 2335 Send(new FrameMsg_SetFocusedFrame(routing_id_)); |
| 2336 } | 2336 } |
| 2337 | 2337 |
| 2338 void RenderFrameHostImpl::ClearFocusedFrame() { |
| 2339 Send(new FrameMsg_ClearFocusedFrame(routing_id_)); |
| 2340 } |
| 2341 |
| 2338 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before, | 2342 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before, |
| 2339 size_t after) { | 2343 size_t after) { |
| 2340 Send(new InputMsg_ExtendSelectionAndDelete(routing_id_, before, after)); | 2344 Send(new InputMsg_ExtendSelectionAndDelete(routing_id_, before, after)); |
| 2341 } | 2345 } |
| 2342 | 2346 |
| 2343 void RenderFrameHostImpl::JavaScriptDialogClosed( | 2347 void RenderFrameHostImpl::JavaScriptDialogClosed( |
| 2344 IPC::Message* reply_msg, | 2348 IPC::Message* reply_msg, |
| 2345 bool success, | 2349 bool success, |
| 2346 const base::string16& user_input, | 2350 const base::string16& user_input, |
| 2347 bool dialog_was_suppressed) { | 2351 bool dialog_was_suppressed) { |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2991 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2995 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2992 | 2996 |
| 2993 if (browser_plugin_embedder_ax_tree_id_ != AXTreeIDRegistry::kNoAXTreeID) | 2997 if (browser_plugin_embedder_ax_tree_id_ != AXTreeIDRegistry::kNoAXTreeID) |
| 2994 dst->parent_tree_id = browser_plugin_embedder_ax_tree_id_; | 2998 dst->parent_tree_id = browser_plugin_embedder_ax_tree_id_; |
| 2995 | 2999 |
| 2996 // If this is not the root frame tree node, we're done. | 3000 // If this is not the root frame tree node, we're done. |
| 2997 if (frame_tree_node()->parent()) | 3001 if (frame_tree_node()->parent()) |
| 2998 return; | 3002 return; |
| 2999 | 3003 |
| 3000 // For the root frame tree node, also store the AXTreeID of the focused frame. | 3004 // For the root frame tree node, also store the AXTreeID of the focused frame. |
| 3005 // TODO(avallee): https://crbug.com/610795: No focus ax events. |
| 3006 // This is probably where we need to fix the bug to enable the test. |
| 3001 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); | 3007 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); |
| 3002 if (!focused_frame_tree_node) | 3008 if (!focused_frame_tree_node) |
| 3003 return; | 3009 return; |
| 3004 RenderFrameHostImpl* focused_frame = | 3010 RenderFrameHostImpl* focused_frame = |
| 3005 focused_frame_tree_node->current_frame_host(); | 3011 focused_frame_tree_node->current_frame_host(); |
| 3006 DCHECK(focused_frame); | 3012 DCHECK(focused_frame); |
| 3007 dst->focused_tree_id = focused_frame->GetAXTreeID(); | 3013 dst->focused_tree_id = focused_frame->GetAXTreeID(); |
| 3008 } | 3014 } |
| 3009 | 3015 |
| 3010 void RenderFrameHostImpl::CreateWebBluetoothService( | 3016 void RenderFrameHostImpl::CreateWebBluetoothService( |
| 3011 blink::mojom::WebBluetoothServiceRequest request) { | 3017 blink::mojom::WebBluetoothServiceRequest request) { |
| 3012 DCHECK(!web_bluetooth_service_); | 3018 DCHECK(!web_bluetooth_service_); |
| 3013 web_bluetooth_service_.reset( | 3019 web_bluetooth_service_.reset( |
| 3014 new WebBluetoothServiceImpl(this, std::move(request))); | 3020 new WebBluetoothServiceImpl(this, std::move(request))); |
| 3015 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the | 3021 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the |
| 3016 // binding_ which may run the error handler. binding_ can't run the error | 3022 // binding_ which may run the error handler. binding_ can't run the error |
| 3017 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 3023 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
| 3018 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3024 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 3019 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3025 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 3020 } | 3026 } |
| 3021 | 3027 |
| 3022 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3028 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 3023 web_bluetooth_service_.reset(); | 3029 web_bluetooth_service_.reset(); |
| 3024 } | 3030 } |
| 3025 | 3031 |
| 3026 } // namespace content | 3032 } // namespace content |
| OLD | NEW |