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

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

Issue 10908028: Allow the X-Chrome-Variations header to transmit to all ports. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 3 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 | « chrome/browser/google/google_url_tracker.cc ('k') | chrome/browser/google/google_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google/google_util.h
diff --git a/chrome/browser/google/google_util.h b/chrome/browser/google/google_util.h
index 377c1e7f71b7fbd6c4620246a735a3ba45b5c1b0..f35ea0098b929bd9155f473768e7d6e2866f11ed 100644
--- a/chrome/browser/google/google_util.h
+++ b/chrome/browser/google/google_util.h
@@ -61,14 +61,25 @@ enum SubdomainPermission {
DISALLOW_SUBDOMAIN,
};
-// True if |url| is an HTTP[S] request with host "[www.]google.<TLD>" and no
-// explicit port. If |permission| is ALLOW_SUBDOMAIN, we check against host
-// "*.google.<TLD>" instead.
-bool IsGoogleDomainUrl(const std::string& url, SubdomainPermission permission);
+// Designate whether or not a URL checking function also checks for standard
+// ports (80 for http, 443 for https), or if it allows all port numbers.
+enum PortPermission {
+ ALLOW_NON_STANDARD_PORTS,
+ DISALLOW_NON_STANDARD_PORTS,
+};
+
+// True if |url| is an HTTP[S] request with host "[www.]google.<TLD>". If
+// |subdomain_permission| is ALLOW_SUBDOMAIN, this checks against host
+// "*.google.<TLD>" instead. If |port_permission| is ALLOW_NON_STANDARD_PORTS,
+// this also allows ports other than 80 for http or 443 for https.
+bool IsGoogleDomainUrl(const std::string& url,
+ SubdomainPermission subdomain_permission,
+ PortPermission port_permission);
// True if |host| is "[www.]google.<TLD>" with a valid TLD. If
-// |permission| is ALLOW_SUBDOMAIN, we check against host "*.google.<TLD>"
-// instead.
-bool IsGoogleHostname(const std::string& host, SubdomainPermission permission);
+// |subdomain_permission| is ALLOW_SUBDOMAIN, we check against host
+// "*.google.<TLD>" instead.
+bool IsGoogleHostname(const std::string& host,
+ SubdomainPermission subdomain_permission);
// True if |url| represents a valid Google home page URL.
bool IsGoogleHomePageUrl(const std::string& url);
// True if |url| represents a valid Google search URL.
« no previous file with comments | « chrome/browser/google/google_url_tracker.cc ('k') | chrome/browser/google/google_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698