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

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: Moved logic to ContentBrowserClient. 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..c51e0058a25393e1d2ab8e9043aa9e0e2c945562 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1154,6 +1154,22 @@ bool ChromeContentBrowserClient::ShouldAllowOpenURL(
return true;
}
+void ChromeContentBrowserClient::OverrideOpenURLParams(
+ const content::SiteInstance* site_instance,
+ content::OpenURLParams* params) {
+ DCHECK(params);
+ if (site_instance &&
+ site_instance->GetSiteURL().SchemeIs(chrome::kChromeSearchScheme) &&
+ site_instance->GetSiteURL().host() ==
+ chrome::kChromeSearchRemoteNtpHost &&
Marc Treib 2016/06/27 13:08:15 Also for the local NTP please!
mastiz 2016/06/27 13:50:53 Done.
+ ui::PageTransitionCoreTypeIs(params->transition,
+ ui::PAGE_TRANSITION_LINK)) {
+ // Make any click on the new tab page a AUTO_BOOKMARK, consistently with
+ // native implementations like Android's.
Marc Treib 2016/06/27 13:08:15 nit: This isn't quite accurate - it'll also make e
mastiz 2016/06/27 13:50:53 Done, PTAL.
+ params->transition = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
Marc Treib 2016/06/27 13:08:15 The old code also set renderer_initiated to false,
mastiz 2016/06/27 13:50:53 Done, went conservative and cleared the field out
+ }
+}
+
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