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.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 params.uses_post = uses_post; | 698 params.uses_post = uses_post; |
| 699 params.post_data = body; | 699 params.post_data = body; |
| 700 params.source_site_instance = source_site_instance; | 700 params.source_site_instance = source_site_instance; |
| 701 if (redirect_chain.size() > 0) | 701 if (redirect_chain.size() > 0) |
| 702 params.redirect_chain = redirect_chain; | 702 params.redirect_chain = redirect_chain; |
| 703 params.should_replace_current_entry = should_replace_current_entry; | 703 params.should_replace_current_entry = should_replace_current_entry; |
| 704 params.user_gesture = user_gesture; | 704 params.user_gesture = user_gesture; |
| 705 | 705 |
| 706 if (render_frame_host->web_ui()) { | 706 if (render_frame_host->web_ui()) { |
| 707 // Web UI pages sometimes want to override the page transition type for | 707 // Web UI pages sometimes want to override the page transition type for |
| 708 // link clicks (e.g., so the new tab page can specify AUTO_BOOKMARK for | 708 // link clicks (e.g., so the new tab page can specify AUTO_BOOKMARK for |
|
Charlie Reis
2016/06/23 22:48:15
Looks like we already used to do this here, back w
Marc Treib
2016/06/24 10:21:41
Yup! Ghosts of NTPs past...
| |
| 709 // automatically generated suggestions). We don't override other types | 709 // automatically generated suggestions). We don't override other types |
| 710 // like TYPED because they have different implications (e.g., autocomplete). | 710 // like TYPED because they have different implications (e.g., autocomplete). |
| 711 if (ui::PageTransitionCoreTypeIs( | 711 if (ui::PageTransitionCoreTypeIs( |
| 712 params.transition, ui::PAGE_TRANSITION_LINK)) | 712 params.transition, ui::PAGE_TRANSITION_LINK)) |
| 713 params.transition = render_frame_host->web_ui()->GetLinkTransitionType(); | 713 params.transition = render_frame_host->web_ui()->GetLinkTransitionType(); |
| 714 | 714 |
| 715 // Note also that we hide the referrer for Web UI pages. We don't really | 715 // Note also that we hide the referrer for Web UI pages. We don't really |
| 716 // want web sites to see a referrer of "chrome://blah" (and some | 716 // want web sites to see a referrer of "chrome://blah" (and some |
| 717 // chrome: URLs might have search terms or other stuff we don't want to | 717 // chrome: URLs might have search terms or other stuff we don't want to |
| 718 // send to the site), so we send no referrer. | 718 // send to the site), so we send no referrer. |
| 719 params.referrer = Referrer(); | 719 params.referrer = Referrer(); |
| 720 | 720 |
| 721 // Navigations in Web UI pages count as browser-initiated navigations. | 721 // Navigations in Web UI pages count as browser-initiated navigations. |
| 722 params.is_renderer_initiated = false; | 722 params.is_renderer_initiated = false; |
| 723 } else if (source_site_instance && | |
| 724 source_site_instance->GetSiteURL().spec() == | |
| 725 "chrome-search://remote-ntp/" && | |
|
Marc Treib
2016/06/22 12:36:34
Oh man, we have too many NTP URLs. I didn't even k
| |
| 726 ui::PageTransitionCoreTypeIs(params.transition, | |
| 727 ui::PAGE_TRANSITION_LINK)) { | |
| 728 // Make any click on the new tab page a AUTO_BOOKMARK, consistently with | |
| 729 // native implementations like Android's. | |
| 730 params.transition = ui::PAGE_TRANSITION_AUTO_BOOKMARK; | |
| 723 } | 731 } |
| 724 | 732 |
| 725 if (delegate_) | 733 if (delegate_) |
| 726 delegate_->RequestOpenURL(render_frame_host, params); | 734 delegate_->RequestOpenURL(render_frame_host, params); |
| 727 } | 735 } |
| 728 | 736 |
| 729 void NavigatorImpl::RequestTransferURL( | 737 void NavigatorImpl::RequestTransferURL( |
| 730 RenderFrameHostImpl* render_frame_host, | 738 RenderFrameHostImpl* render_frame_host, |
| 731 const GURL& url, | 739 const GURL& url, |
| 732 SiteInstance* source_site_instance, | 740 SiteInstance* source_site_instance, |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1179 if (pending_entry != controller_->GetVisibleEntry() || | 1187 if (pending_entry != controller_->GetVisibleEntry() || |
| 1180 !should_preserve_entry) { | 1188 !should_preserve_entry) { |
| 1181 controller_->DiscardPendingEntry(true); | 1189 controller_->DiscardPendingEntry(true); |
| 1182 | 1190 |
| 1183 // Also force the UI to refresh. | 1191 // Also force the UI to refresh. |
| 1184 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1192 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1185 } | 1193 } |
| 1186 } | 1194 } |
| 1187 | 1195 |
| 1188 } // namespace content | 1196 } // namespace content |
| OLD | NEW |