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

Unified Diff: chrome/browser/google/google_util.cc

Issue 17022004: Replace --google-base-suggest-url and --instant-url with --google-base-url. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 | « no previous file | chrome/browser/google/google_util_unittest.cc » ('j') | chrome/browser/search/search.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google/google_util.cc
===================================================================
--- chrome/browser/google/google_util.cc (revision 206485)
+++ chrome/browser/google/google_util.cc (working copy)
@@ -155,25 +155,10 @@
bool IsGoogleDomainUrl(const std::string& url,
Jered 2013/06/25 16:30:39 All the callers turn a GURL into a string, then we
Peter Kasting 2013/06/25 23:06:36 Done. For consistency I also switched IsGoogleHom
SubdomainPermission subdomain_permission,
PortPermission port_permission) {
- GURL original_url(url);
- if (!original_url.is_valid() ||
- !(original_url.SchemeIs("http") || original_url.SchemeIs("https")))
- return false;
-
- // If we have the Instant URL overridden with a command line flag, accept
- // its domain/port combination as well.
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kInstantURL)) {
- GURL custom_instant_url(
- command_line.GetSwitchValueASCII(switches::kInstantURL));
- if (original_url.host() == custom_instant_url.host() &&
- original_url.port() == custom_instant_url.port())
- return true;
- }
-
- return (original_url.port().empty() ||
- port_permission == ALLOW_NON_STANDARD_PORTS) &&
- google_util::IsGoogleHostname(original_url.host(), subdomain_permission);
+ GURL gurl(url);
+ return gurl.is_valid() && (gurl.SchemeIs("http") || gurl.SchemeIs("https")) &&
+ (gurl.port().empty() || (port_permission == ALLOW_NON_STANDARD_PORTS)) &&
+ google_util::IsGoogleHostname(gurl.host(), subdomain_permission);
}
bool IsGoogleHostname(const std::string& host,
« no previous file with comments | « no previous file | chrome/browser/google/google_util_unittest.cc » ('j') | chrome/browser/search/search.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698