| OLD | NEW |
| 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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 url.SchemeIs(content::kChromeUIScheme) && | 1161 url.SchemeIs(content::kChromeUIScheme) && |
| 1162 url.host_piece() != chrome::kChromeUIChromeSigninHost) { | 1162 url.host_piece() != chrome::kChromeUIChromeSigninHost) { |
| 1163 VLOG(1) << "Blocked navigation to " << url.spec() << " from " | 1163 VLOG(1) << "Blocked navigation to " << url.spec() << " from " |
| 1164 << chrome::kChromeUIChromeSigninURL; | 1164 << chrome::kChromeUIChromeSigninURL; |
| 1165 return false; | 1165 return false; |
| 1166 } | 1166 } |
| 1167 | 1167 |
| 1168 return true; | 1168 return true; |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 void ChromeContentBrowserClient::OverrideOpenURLParams( |
| 1172 content::SiteInstance* site_instance, |
| 1173 content::OpenURLParams* params) { |
| 1174 DCHECK(params); |
| 1175 // TODO(crbug.com/624410): Factor the predicate to identify a URL as an NTP |
| 1176 // to a shared library. |
| 1177 if (site_instance && |
| 1178 site_instance->GetSiteURL().SchemeIs(chrome::kChromeSearchScheme) && |
| 1179 (site_instance->GetSiteURL().host() == |
| 1180 chrome::kChromeSearchRemoteNtpHost || |
| 1181 site_instance->GetSiteURL().host() == |
| 1182 chrome::kChromeSearchLocalNtpHost) && |
| 1183 ui::PageTransitionCoreTypeIs(params->transition, |
| 1184 ui::PAGE_TRANSITION_LINK)) { |
| 1185 // Use AUTO_BOOKMARK for clicks on tiles of the new tab page, consistently |
| 1186 // with native implementations like Android's. |
| 1187 params->transition = ui::PAGE_TRANSITION_AUTO_BOOKMARK; |
| 1188 params->is_renderer_initiated = false; |
| 1189 params->referrer = content::Referrer(); |
| 1190 } |
| 1191 } |
| 1192 |
| 1171 bool ChromeContentBrowserClient::IsSuitableHost( | 1193 bool ChromeContentBrowserClient::IsSuitableHost( |
| 1172 content::RenderProcessHost* process_host, | 1194 content::RenderProcessHost* process_host, |
| 1173 const GURL& site_url) { | 1195 const GURL& site_url) { |
| 1174 Profile* profile = | 1196 Profile* profile = |
| 1175 Profile::FromBrowserContext(process_host->GetBrowserContext()); | 1197 Profile::FromBrowserContext(process_host->GetBrowserContext()); |
| 1176 // This may be NULL during tests. In that case, just assume any site can | 1198 // This may be NULL during tests. In that case, just assume any site can |
| 1177 // share any host. | 1199 // share any host. |
| 1178 if (!profile) | 1200 if (!profile) |
| 1179 return true; | 1201 return true; |
| 1180 | 1202 |
| (...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 if (channel <= kMaxDisableEncryptionChannel) { | 3006 if (channel <= kMaxDisableEncryptionChannel) { |
| 2985 static const char* const kWebRtcDevSwitchNames[] = { | 3007 static const char* const kWebRtcDevSwitchNames[] = { |
| 2986 switches::kDisableWebRtcEncryption, | 3008 switches::kDisableWebRtcEncryption, |
| 2987 }; | 3009 }; |
| 2988 to_command_line->CopySwitchesFrom(from_command_line, | 3010 to_command_line->CopySwitchesFrom(from_command_line, |
| 2989 kWebRtcDevSwitchNames, | 3011 kWebRtcDevSwitchNames, |
| 2990 arraysize(kWebRtcDevSwitchNames)); | 3012 arraysize(kWebRtcDevSwitchNames)); |
| 2991 } | 3013 } |
| 2992 } | 3014 } |
| 2993 #endif // defined(ENABLE_WEBRTC) | 3015 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |