| OLD | NEW |
| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | |
| 13 | |
| 14 class GURL; | 12 class GURL; |
| 15 | 13 |
| 16 // This namespace provides various helpers around handling Google-related URLs. | 14 // This namespace provides various helpers around handling Google-related URLs. |
| 17 namespace google_util { | 15 namespace google_util { |
| 18 | 16 |
| 19 // True iff |str| contains a "q=" or "as_q=" query parameter with a non-empty | 17 // True iff |str| contains a "q=" or "as_q=" query parameter with a non-empty |
| 20 // value. |str| should be a query or a hash fragment, without the ? or # (as | 18 // value. |str| should be a query or a hash fragment, without the ? or # (as |
| 21 // returned by GURL::query() or GURL::ref(). | 19 // returned by GURL::query() or GURL::ref(). |
| 22 bool HasGoogleSearchQueryParam(const std::string& str); | 20 bool HasGoogleSearchQueryParam(const std::string& str); |
| 23 | 21 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // True if |url| is a valid youtube.<TLD> URL. If |port_permission| is | 101 // True if |url| is a valid youtube.<TLD> URL. If |port_permission| is |
| 104 // DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard | 102 // DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard |
| 105 // port for its scheme (80 for HTTP, 443 for HTTPS). | 103 // port for its scheme (80 for HTTP, 443 for HTTPS). |
| 106 bool IsYoutubeDomainUrl(const GURL& url, | 104 bool IsYoutubeDomainUrl(const GURL& url, |
| 107 SubdomainPermission subdomain_permission, | 105 SubdomainPermission subdomain_permission, |
| 108 PortPermission port_permission); | 106 PortPermission port_permission); |
| 109 | 107 |
| 110 } // namespace google_util | 108 } // namespace google_util |
| 111 | 109 |
| 112 #endif // COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_ | 110 #endif // COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_UTIL_H_ |
| OLD | NEW |