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

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: Addressed nit. 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 cce6055d14114802396ae3cbd025d6e14eba2cb0..c8c43652acb259c92ccaa179f9e25eaa0d5b8db8 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1154,6 +1154,26 @@ bool ChromeContentBrowserClient::ShouldAllowOpenURL(
return true;
}
+void ChromeContentBrowserClient::OverrideOpenURLParams(
+ content::SiteInstance* site_instance,
+ content::OpenURLParams* params) {
+ DCHECK(params);
+ if (site_instance &&
+ site_instance->GetSiteURL().SchemeIs(chrome::kChromeSearchScheme) &&
+ (site_instance->GetSiteURL().host() ==
+ chrome::kChromeSearchRemoteNtpHost ||
+ site_instance->GetSiteURL().host() ==
+ chrome::kChromeSearchLocalNtpHost) &&
Charlie Reis 2016/06/28 17:57:35 Sanity check: The NTP SiteInstance's Site URL is n
mastiz 2016/06/29 14:20:14 I double-checked and for the case above, it is ind
Charlie Reis 2016/06/29 19:27:00 Thanks for checking.
+ 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