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

Side by Side Diff: components/google/core/browser/google_util.h

Issue 2861183002: Google search subdomains included for Safesearch (Closed)
Patch Set: Fixed review comments Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // Some Google related utility functions. 5 // Some Google related utility functions.
6 6
7 #ifndef COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_ 7 #ifndef COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_
8 #define COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_ 8 #define COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_
9 9
10 #include <string> 10 #include <string>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // port for its scheme (80 for HTTP, 443 for HTTPS). 92 // port for its scheme (80 for HTTP, 443 for HTTPS).
93 // 93 //
94 // Note that this only checks for google.<TLD> domains, but not other Google 94 // Note that this only checks for google.<TLD> domains, but not other Google
95 // properties. There is code in variations_http_header_provider.cc that checks 95 // properties. There is code in variations_http_header_provider.cc that checks
96 // for additional Google properties, which can be moved here if more callers 96 // for additional Google properties, which can be moved here if more callers
97 // are interested in this in the future. 97 // are interested in this in the future.
98 bool IsGoogleDomainUrl(const GURL& url, 98 bool IsGoogleDomainUrl(const GURL& url,
99 SubdomainPermission subdomain_permission, 99 SubdomainPermission subdomain_permission,
100 PortPermission port_permission); 100 PortPermission port_permission);
101 101
102 // True if |url| is a valid URL with a host that is in the static list of
103 // Google subdomains for google search, and an HTTP or HTTPS scheme. If
104 // |port_permission| is DISALLOW_NON_STANDARD_PORTS, this also requires |url| to
105 // use the standard port for its scheme (80 for HTTP, 443 for HTTPS).
106 bool IsGoogleSearchSubdomainUrl(const GURL& url,
107 PortPermission port_permission);
Ilya Sherman 2017/05/11 00:33:35 Does this function need to be public, or could it
igorcov 2017/05/11 11:30:05 Done.
108
102 // True if |url| represents a valid Google home page URL. 109 // True if |url| represents a valid Google home page URL.
103 bool IsGoogleHomePageUrl(const GURL& url); 110 bool IsGoogleHomePageUrl(const GURL& url);
104 111
105 // True if |url| represents a valid Google search URL. 112 // True if |url| represents a valid Google search URL.
106 bool IsGoogleSearchUrl(const GURL& url); 113 bool IsGoogleSearchUrl(const GURL& url);
107 114
108 // True if |url| is a valid youtube.<TLD> URL. If |port_permission| is 115 // True if |url| is a valid youtube.<TLD> URL. If |port_permission| is
109 // DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard 116 // DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard
110 // port for its scheme (80 for HTTP, 443 for HTTPS). 117 // port for its scheme (80 for HTTP, 443 for HTTPS).
111 bool IsYoutubeDomainUrl(const GURL& url, 118 bool IsYoutubeDomainUrl(const GURL& url,
112 SubdomainPermission subdomain_permission, 119 SubdomainPermission subdomain_permission,
113 PortPermission port_permission); 120 PortPermission port_permission);
114 121
115 } // namespace google_util 122 } // namespace google_util
116 123
117 #endif // COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_ 124 #endif // COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | components/google/core/browser/google_util.cc » ('j') | components/google/core/browser/google_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698