Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2084953003: Fix clicks on NTP tiles not contributing to Most Visited tiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODO. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 734bd648622910c5b38e8b5d32d85f8c8f7da74b..190bb8416b9a19a8547b1f2d9494e72d1a3c0206 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1168,6 +1168,28 @@ bool ChromeContentBrowserClient::ShouldAllowOpenURL(
return true;
}
+void ChromeContentBrowserClient::OverrideOpenURLParams(
+ content::SiteInstance* site_instance,
+ content::OpenURLParams* params) {
+ DCHECK(params);
+ // TODO(crbug.com/624410): Factor the predicate to identify a URL as an NTP
+ // to a shared library.
+ if (site_instance &&
+ site_instance->GetSiteURL().SchemeIs(chrome::kChromeSearchScheme) &&
+ (site_instance->GetSiteURL().host() ==
+ chrome::kChromeSearchRemoteNtpHost ||
+ site_instance->GetSiteURL().host() ==
+ chrome::kChromeSearchLocalNtpHost) &&
+ ui::PageTransitionCoreTypeIs(params->transition,
+ ui::PAGE_TRANSITION_LINK)) {
+ // Use AUTO_BOOKMARK for clicks on tiles of the new tab page, consistently
+ // with native implementations like Android's.
+ params->transition = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
+ params->is_renderer_initiated = false;
+ params->referrer = content::Referrer();
+ }
+}
+
bool ChromeContentBrowserClient::IsSuitableHost(
content::RenderProcessHost* process_host,
const GURL& site_url) {
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698