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

Side by Side 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 comments. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 url.SchemeIs(content::kChromeUIScheme) && 1147 url.SchemeIs(content::kChromeUIScheme) &&
1148 url.host_piece() != chrome::kChromeUIChromeSigninHost) { 1148 url.host_piece() != chrome::kChromeUIChromeSigninHost) {
1149 VLOG(1) << "Blocked navigation to " << url.spec() << " from " 1149 VLOG(1) << "Blocked navigation to " << url.spec() << " from "
1150 << chrome::kChromeUIChromeSigninURL; 1150 << chrome::kChromeUIChromeSigninURL;
1151 return false; 1151 return false;
1152 } 1152 }
1153 1153
1154 return true; 1154 return true;
1155 } 1155 }
1156 1156
1157 void ChromeContentBrowserClient::OverrideOpenURLParams(
1158 const content::SiteInstance* site_instance,
1159 content::OpenURLParams* params) {
1160 DCHECK(params);
1161 if (site_instance &&
1162 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
1163 (site_instance->GetSiteURL().host() ==
1164 chrome::kChromeSearchRemoteNtpHost ||
1165 site_instance->GetSiteURL().host() ==
1166 chrome::kChromeSearchLocalNtpHost) &&
1167 ui::PageTransitionCoreTypeIs(params->transition,
1168 ui::PAGE_TRANSITION_LINK)) {
1169 // Use AUTO_BOOKMARK for clicks on tiles of the new tab page, consistently
1170 // with native implementations like Android's.
1171 params->transition = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
1172 params->is_renderer_initiated = false;
1173 params->referrer = content::Referrer();
1174 }
1175 }
1176
1157 bool ChromeContentBrowserClient::IsSuitableHost( 1177 bool ChromeContentBrowserClient::IsSuitableHost(
1158 content::RenderProcessHost* process_host, 1178 content::RenderProcessHost* process_host,
1159 const GURL& site_url) { 1179 const GURL& site_url) {
1160 Profile* profile = 1180 Profile* profile =
1161 Profile::FromBrowserContext(process_host->GetBrowserContext()); 1181 Profile::FromBrowserContext(process_host->GetBrowserContext());
1162 // This may be NULL during tests. In that case, just assume any site can 1182 // This may be NULL during tests. In that case, just assume any site can
1163 // share any host. 1183 // share any host.
1164 if (!profile) 1184 if (!profile)
1165 return true; 1185 return true;
1166 1186
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 if (channel <= kMaxDisableEncryptionChannel) { 2989 if (channel <= kMaxDisableEncryptionChannel) {
2970 static const char* const kWebRtcDevSwitchNames[] = { 2990 static const char* const kWebRtcDevSwitchNames[] = {
2971 switches::kDisableWebRtcEncryption, 2991 switches::kDisableWebRtcEncryption,
2972 }; 2992 };
2973 to_command_line->CopySwitchesFrom(from_command_line, 2993 to_command_line->CopySwitchesFrom(from_command_line,
2974 kWebRtcDevSwitchNames, 2994 kWebRtcDevSwitchNames,
2975 arraysize(kWebRtcDevSwitchNames)); 2995 arraysize(kWebRtcDevSwitchNames));
2976 } 2996 }
2977 } 2997 }
2978 #endif // defined(ENABLE_WEBRTC) 2998 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698