| 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 // should "use up" the SiteInstance. | 706 // should "use up" the SiteInstance. |
| 707 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); | 707 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); |
| 708 } | 708 } |
| 709 | 709 |
| 710 void NavigatorImpl::RequestOpenURL( | 710 void NavigatorImpl::RequestOpenURL( |
| 711 RenderFrameHostImpl* render_frame_host, | 711 RenderFrameHostImpl* render_frame_host, |
| 712 const GURL& url, | 712 const GURL& url, |
| 713 bool uses_post, | 713 bool uses_post, |
| 714 const scoped_refptr<ResourceRequestBodyImpl>& body, | 714 const scoped_refptr<ResourceRequestBodyImpl>& body, |
| 715 const std::string& extra_headers, | 715 const std::string& extra_headers, |
| 716 SiteInstance* source_site_instance, | |
| 717 const Referrer& referrer, | 716 const Referrer& referrer, |
| 718 WindowOpenDisposition disposition, | 717 WindowOpenDisposition disposition, |
| 719 bool should_replace_current_entry, | 718 bool should_replace_current_entry, |
| 720 bool user_gesture) { | 719 bool user_gesture) { |
| 721 // Note: This can be called for subframes (even when OOPIFs are not possible) | 720 // Note: This can be called for subframes (even when OOPIFs are not possible) |
| 722 // if the disposition calls for a different window. | 721 // if the disposition calls for a different window. |
| 723 | 722 |
| 724 // Only the current RenderFrameHost should be sending an OpenURL request. | 723 // Only the current RenderFrameHost should be sending an OpenURL request. |
| 725 // Pending RenderFrameHost should know where it is navigating and pending | 724 // Pending RenderFrameHost should know where it is navigating and pending |
| 726 // deletion RenderFrameHost shouldn't be trying to navigate. | 725 // deletion RenderFrameHost shouldn't be trying to navigate. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 755 frame_tree_node_id = | 754 frame_tree_node_id = |
| 756 render_frame_host->frame_tree_node()->frame_tree_node_id(); | 755 render_frame_host->frame_tree_node()->frame_tree_node_id(); |
| 757 } | 756 } |
| 758 | 757 |
| 759 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition, | 758 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition, |
| 760 ui::PAGE_TRANSITION_LINK, | 759 ui::PAGE_TRANSITION_LINK, |
| 761 true /* is_renderer_initiated */); | 760 true /* is_renderer_initiated */); |
| 762 params.uses_post = uses_post; | 761 params.uses_post = uses_post; |
| 763 params.post_data = body; | 762 params.post_data = body; |
| 764 params.extra_headers = extra_headers; | 763 params.extra_headers = extra_headers; |
| 765 params.source_site_instance = source_site_instance; | |
| 766 if (redirect_chain.size() > 0) | 764 if (redirect_chain.size() > 0) |
| 767 params.redirect_chain = redirect_chain; | 765 params.redirect_chain = redirect_chain; |
| 768 params.should_replace_current_entry = should_replace_current_entry; | 766 params.should_replace_current_entry = should_replace_current_entry; |
| 769 params.user_gesture = user_gesture; | 767 params.user_gesture = user_gesture; |
| 770 | 768 |
| 769 // RequestOpenURL is used only for local frames, so we can get here only if |
| 770 // the navigation is initiated by a frame in the same SiteInstance as this |
| 771 // frame. Note that navigations on RenderFrameProxies do not use |
| 772 // RequestOpenURL and go through RequestTransferURL instead. |
| 773 params.source_site_instance = current_site_instance; |
| 774 |
| 771 if (render_frame_host->web_ui()) { | 775 if (render_frame_host->web_ui()) { |
| 772 // Web UI pages sometimes want to override the page transition type for | 776 // Web UI pages sometimes want to override the page transition type for |
| 773 // link clicks (e.g., so the new tab page can specify AUTO_BOOKMARK for | 777 // link clicks (e.g., so the new tab page can specify AUTO_BOOKMARK for |
| 774 // automatically generated suggestions). We don't override other types | 778 // automatically generated suggestions). We don't override other types |
| 775 // like TYPED because they have different implications (e.g., autocomplete). | 779 // like TYPED because they have different implications (e.g., autocomplete). |
| 776 if (ui::PageTransitionCoreTypeIs( | 780 if (ui::PageTransitionCoreTypeIs( |
| 777 params.transition, ui::PAGE_TRANSITION_LINK)) | 781 params.transition, ui::PAGE_TRANSITION_LINK)) |
| 778 params.transition = render_frame_host->web_ui()->GetLinkTransitionType(); | 782 params.transition = render_frame_host->web_ui()->GetLinkTransitionType(); |
| 779 | 783 |
| 780 // Note also that we hide the referrer for Web UI pages. We don't really | 784 // Note also that we hide the referrer for Web UI pages. We don't really |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 if (navigation_handle) | 1276 if (navigation_handle) |
| 1273 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1277 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
| 1274 | 1278 |
| 1275 controller_->SetPendingEntry(std::move(entry)); | 1279 controller_->SetPendingEntry(std::move(entry)); |
| 1276 if (delegate_) | 1280 if (delegate_) |
| 1277 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1281 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1278 } | 1282 } |
| 1279 } | 1283 } |
| 1280 | 1284 |
| 1281 } // namespace content | 1285 } // namespace content |
| OLD | NEW |