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/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; | 764 params.source_site_instance = current_site_instance; |
|
Charlie Reis
2016/11/02 17:05:36
Let's put a comment on this, saying that only same
alexmos
2016/11/03 06:03:01
Done.
| |
| 766 if (redirect_chain.size() > 0) | 765 if (redirect_chain.size() > 0) |
| 767 params.redirect_chain = redirect_chain; | 766 params.redirect_chain = redirect_chain; |
| 768 params.should_replace_current_entry = should_replace_current_entry; | 767 params.should_replace_current_entry = should_replace_current_entry; |
| 769 params.user_gesture = user_gesture; | 768 params.user_gesture = user_gesture; |
| 770 | 769 |
| 771 if (render_frame_host->web_ui()) { | 770 if (render_frame_host->web_ui()) { |
| 772 // Web UI pages sometimes want to override the page transition type for | 771 // 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 | 772 // link clicks (e.g., so the new tab page can specify AUTO_BOOKMARK for |
| 774 // automatically generated suggestions). We don't override other types | 773 // automatically generated suggestions). We don't override other types |
| 775 // like TYPED because they have different implications (e.g., autocomplete). | 774 // like TYPED because they have different implications (e.g., autocomplete). |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1272 if (navigation_handle) | 1271 if (navigation_handle) |
| 1273 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1272 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
| 1274 | 1273 |
| 1275 controller_->SetPendingEntry(std::move(entry)); | 1274 controller_->SetPendingEntry(std::move(entry)); |
| 1276 if (delegate_) | 1275 if (delegate_) |
| 1277 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1276 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1278 } | 1277 } |
| 1279 } | 1278 } |
| 1280 | 1279 |
| 1281 } // namespace content | 1280 } // namespace content |
| OLD | NEW |