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

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: Moved logic to ContentBrowserClient. 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) &&
1163 site_instance->GetSiteURL().host() ==
1164 chrome::kChromeSearchRemoteNtpHost &&
Marc Treib 2016/06/27 13:08:15 Also for the local NTP please!
mastiz 2016/06/27 13:50:53 Done.
1165 ui::PageTransitionCoreTypeIs(params->transition,
1166 ui::PAGE_TRANSITION_LINK)) {
1167 // Make any click on the new tab page a AUTO_BOOKMARK, consistently with
1168 // 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.
1169 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
1170 }
1171 }
1172
1157 bool ChromeContentBrowserClient::IsSuitableHost( 1173 bool ChromeContentBrowserClient::IsSuitableHost(
1158 content::RenderProcessHost* process_host, 1174 content::RenderProcessHost* process_host,
1159 const GURL& site_url) { 1175 const GURL& site_url) {
1160 Profile* profile = 1176 Profile* profile =
1161 Profile::FromBrowserContext(process_host->GetBrowserContext()); 1177 Profile::FromBrowserContext(process_host->GetBrowserContext());
1162 // This may be NULL during tests. In that case, just assume any site can 1178 // This may be NULL during tests. In that case, just assume any site can
1163 // share any host. 1179 // share any host.
1164 if (!profile) 1180 if (!profile)
1165 return true; 1181 return true;
1166 1182
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 if (channel <= kMaxDisableEncryptionChannel) { 2985 if (channel <= kMaxDisableEncryptionChannel) {
2970 static const char* const kWebRtcDevSwitchNames[] = { 2986 static const char* const kWebRtcDevSwitchNames[] = {
2971 switches::kDisableWebRtcEncryption, 2987 switches::kDisableWebRtcEncryption,
2972 }; 2988 };
2973 to_command_line->CopySwitchesFrom(from_command_line, 2989 to_command_line->CopySwitchesFrom(from_command_line,
2974 kWebRtcDevSwitchNames, 2990 kWebRtcDevSwitchNames,
2975 arraysize(kWebRtcDevSwitchNames)); 2991 arraysize(kWebRtcDevSwitchNames));
2976 } 2992 }
2977 } 2993 }
2978 #endif // defined(ENABLE_WEBRTC) 2994 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« 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