| 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 // Some Google related utility functions. | 5 // Some Google related utility functions. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ | 7 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ |
| 8 #define CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ | 8 #define CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // |str| should be a query or a hash fragment, without the ? or # (as | 22 // |str| should be a query or a hash fragment, without the ? or # (as |
| 23 // returned by GURL::query() or GURL::ref(). | 23 // returned by GURL::query() or GURL::ref(). |
| 24 bool HasGoogleSearchQueryParam(const std::string& str); | 24 bool HasGoogleSearchQueryParam(const std::string& str); |
| 25 | 25 |
| 26 // The query key that identifies a Google Extended API request for Instant. | 26 // The query key that identifies a Google Extended API request for Instant. |
| 27 const char kInstantExtendedAPIParam[] = "espv"; | 27 const char kInstantExtendedAPIParam[] = "espv"; |
| 28 | 28 |
| 29 GURL LinkDoctorBaseURL(); | 29 GURL LinkDoctorBaseURL(); |
| 30 void SetMockLinkDoctorBaseURLForTesting(); | 30 void SetMockLinkDoctorBaseURLForTesting(); |
| 31 | 31 |
| 32 // Returns the Google locale. This is the same string as | |
| 33 // AppendGoogleLocaleParam adds to the URL, only without the leading "hl". | |
| 34 std::string GetGoogleLocale(); | |
| 35 | |
| 36 // Adds the Google locale string to the URL (e.g., hl=en-US). This does not | 32 // Adds the Google locale string to the URL (e.g., hl=en-US). This does not |
| 37 // check to see if the param already exists. | 33 // check to see if the param already exists. |
| 38 GURL AppendGoogleLocaleParam(const GURL& url); | 34 GURL AppendGoogleLocaleParam(const GURL& url); |
| 39 | 35 |
| 40 // String version of AppendGoogleLocaleParam. | 36 // String version of AppendGoogleLocaleParam. |
| 41 std::string StringAppendGoogleLocaleParam(const std::string& url); | 37 std::string StringAppendGoogleLocaleParam(const std::string& url); |
| 42 | 38 |
| 43 // Returns the Google country code string for the given profile. | 39 // Adds the Google TLD string for the given profile to the URL (e.g., sd=com). |
| 44 std::string GetGoogleCountryCode(Profile* profile); | 40 // This does not check to see if the param already exists. |
| 45 | 41 GURL AppendGoogleTLDParam(Profile* profile, const GURL& url); |
| 46 // Returns the Google search URL for the given profile. | |
| 47 GURL GetGoogleSearchURL(Profile* profile); | |
| 48 | 42 |
| 49 // Returns in |brand| the brand code or distribution tag that has been | 43 // Returns in |brand| the brand code or distribution tag that has been |
| 50 // assigned to a partner. Returns false if the information is not available. | 44 // assigned to a partner. Returns false if the information is not available. |
| 51 bool GetBrand(std::string* brand); | 45 bool GetBrand(std::string* brand); |
| 52 | 46 |
| 53 // Returns in |brand| the reactivation brand code or distribution tag | 47 // Returns in |brand| the reactivation brand code or distribution tag |
| 54 // that has been assigned to a partner for reactivating a dormant chrome | 48 // that has been assigned to a partner for reactivating a dormant chrome |
| 55 // install. Returns false if the information is not available. | 49 // install. Returns false if the information is not available. |
| 56 bool GetReactivationBrand(std::string* brand); | 50 bool GetReactivationBrand(std::string* brand); |
| 57 | 51 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ~BrandForTesting(); | 127 ~BrandForTesting(); |
| 134 | 128 |
| 135 private: | 129 private: |
| 136 std::string brand_; | 130 std::string brand_; |
| 137 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); | 131 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); |
| 138 }; | 132 }; |
| 139 | 133 |
| 140 } // namespace google_util | 134 } // namespace google_util |
| 141 | 135 |
| 142 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ | 136 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ |
| OLD | NEW |