Chromium Code Reviews| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 574 } | 574 } |
| 575 | 575 |
| 576 void RenderFrameHostImpl::OnDetach() { | 576 void RenderFrameHostImpl::OnDetach() { |
| 577 frame_tree_->RemoveFrame(frame_tree_node_); | 577 frame_tree_->RemoveFrame(frame_tree_node_); |
| 578 } | 578 } |
| 579 | 579 |
| 580 void RenderFrameHostImpl::OnFrameFocused() { | 580 void RenderFrameHostImpl::OnFrameFocused() { |
| 581 frame_tree_->SetFocusedFrame(frame_tree_node_); | 581 frame_tree_->SetFocusedFrame(frame_tree_node_); |
| 582 } | 582 } |
| 583 | 583 |
| 584 void RenderFrameHostImpl::OnOpenURL( | 584 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { |
| 585 const FrameHostMsg_OpenURL_Params& params) { | 585 OpenURL(params, nullptr); |
|
Charlie Reis
2014/12/06 00:18:50
Let's pass GetSiteInstance().
lfg
2014/12/08 20:45:33
Done.
| |
| 586 GURL validated_url(params.url); | |
| 587 GetProcess()->FilterURL(false, &validated_url); | |
| 588 | |
| 589 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OnOpenURL", | |
| 590 "url", validated_url.possibly_invalid_spec()); | |
| 591 frame_tree_node_->navigator()->RequestOpenURL( | |
| 592 this, validated_url, params.referrer, params.disposition, | |
| 593 params.should_replace_current_entry, params.user_gesture); | |
| 594 } | 586 } |
| 595 | 587 |
| 596 void RenderFrameHostImpl::OnDocumentOnLoadCompleted() { | 588 void RenderFrameHostImpl::OnDocumentOnLoadCompleted() { |
| 597 // This message is only sent for top-level frames. TODO(avi): when frame tree | 589 // This message is only sent for top-level frames. TODO(avi): when frame tree |
| 598 // mirroring works correctly, add a check here to enforce it. | 590 // mirroring works correctly, add a check here to enforce it. |
| 599 delegate_->DocumentOnLoadCompleted(this); | 591 delegate_->DocumentOnLoadCompleted(this); |
| 600 } | 592 } |
| 601 | 593 |
| 602 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame( | 594 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame( |
| 603 const GURL& url, | 595 const GURL& url, |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1261 params.common_params.transition = ui::PAGE_TRANSITION_LINK; | 1253 params.common_params.transition = ui::PAGE_TRANSITION_LINK; |
| 1262 params.common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 1254 params.common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 1263 params.commit_params.browser_navigation_start = base::TimeTicks::Now(); | 1255 params.commit_params.browser_navigation_start = base::TimeTicks::Now(); |
| 1264 params.page_id = -1; | 1256 params.page_id = -1; |
| 1265 params.pending_history_list_offset = -1; | 1257 params.pending_history_list_offset = -1; |
| 1266 params.current_history_list_offset = -1; | 1258 params.current_history_list_offset = -1; |
| 1267 params.current_history_list_length = 0; | 1259 params.current_history_list_length = 0; |
| 1268 Navigate(params); | 1260 Navigate(params); |
| 1269 } | 1261 } |
| 1270 | 1262 |
| 1271 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params) { | 1263 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params, |
| 1272 OnOpenURL(params); | 1264 SiteInstance* site_instance) { |
| 1265 GURL validated_url(params.url); | |
| 1266 GetProcess()->FilterURL(false, &validated_url); | |
| 1267 | |
| 1268 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OnOpenURL", "url", | |
| 1269 validated_url.possibly_invalid_spec()); | |
| 1270 frame_tree_node_->navigator()->RequestOpenURL( | |
| 1271 this, validated_url, site_instance, params.referrer, params.disposition, | |
| 1272 params.should_replace_current_entry, params.user_gesture); | |
| 1273 } | 1273 } |
| 1274 | 1274 |
| 1275 void RenderFrameHostImpl::Stop() { | 1275 void RenderFrameHostImpl::Stop() { |
| 1276 Send(new FrameMsg_Stop(routing_id_)); | 1276 Send(new FrameMsg_Stop(routing_id_)); |
| 1277 } | 1277 } |
| 1278 | 1278 |
| 1279 void RenderFrameHostImpl::DispatchBeforeUnload(bool for_cross_site_transition) { | 1279 void RenderFrameHostImpl::DispatchBeforeUnload(bool for_cross_site_transition) { |
| 1280 // TODO(creis): Support beforeunload on subframes. For now just pretend that | 1280 // TODO(creis): Support beforeunload on subframes. For now just pretend that |
| 1281 // the handler ran and allowed the navigation to proceed. | 1281 // the handler ran and allowed the navigation to proceed. |
| 1282 if (GetParent() || !IsRenderFrameLive()) { | 1282 if (GetParent() || !IsRenderFrameLive()) { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1572 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1572 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
| 1573 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1573 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
| 1574 GetContentClient()->browser()->RegisterPermissionUsage( | 1574 GetContentClient()->browser()->RegisterPermissionUsage( |
| 1575 PERMISSION_GEOLOCATION, | 1575 PERMISSION_GEOLOCATION, |
| 1576 delegate_->GetAsWebContents(), | 1576 delegate_->GetAsWebContents(), |
| 1577 GetLastCommittedURL().GetOrigin(), | 1577 GetLastCommittedURL().GetOrigin(), |
| 1578 top_frame->GetLastCommittedURL().GetOrigin()); | 1578 top_frame->GetLastCommittedURL().GetOrigin()); |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 } // namespace content | 1581 } // namespace content |
| OLD | NEW |