Chromium Code Reviews| 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..5e0239060d27315eecc46319a47921855dab3f47 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( |
| + const content::SiteInstance* site_instance, |
| + content::OpenURLParams* params) { |
| + DCHECK(params); |
| + if (site_instance && |
| + site_instance->GetSiteURL().SchemeIs(chrome::kChromeSearchScheme) && |
|
Charlie Reis
2016/06/28 00:52:05
There must be an existing way to check whether a t
mastiz
2016/06/28 08:20:31
Unfortunately there is no such predicate in C++ co
Marc Treib
2016/06/28 08:57:07
Let me add my +1 here. You would indeed think that
Charlie Reis
2016/06/28 17:57:35
Yes, it's unfortunate we don't have something we c
mastiz
2016/06/29 14:20:14
Added a TODO as suggested.
Honestly, I don't thin
Charlie Reis
2016/06/29 19:27:00
I posted a comment to the bug, since I think this
|
| + (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) { |