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 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 // Returns in |brand| the brand code or distribution tag that has been | 32 // Returns in |brand| the brand code or distribution tag that has been |
33 // assigned to a partner. Returns false if the information is not available. | 33 // assigned to a partner. Returns false if the information is not available. |
34 bool GetBrand(std::string* brand); | 34 bool GetBrand(std::string* brand); |
35 | 35 |
36 // Returns in |brand| the reactivation brand code or distribution tag | 36 // Returns in |brand| the reactivation brand code or distribution tag |
37 // that has been assigned to a partner for reactivating a dormant chrome | 37 // that has been assigned to a partner for reactivating a dormant chrome |
38 // install. Returns false if the information is not available. | 38 // install. Returns false if the information is not available. |
39 bool GetReactivationBrand(std::string* brand); | 39 bool GetReactivationBrand(std::string* brand); |
40 | 40 |
| 41 // True if |host| is "[www.]google.<TLD>" with a valid TLD. |
| 42 bool IsGoogleHostname(const std::string& host); |
| 43 |
41 // True if |url| represents a valid Google home page URL. | 44 // True if |url| represents a valid Google home page URL. |
42 bool IsGoogleHomePageUrl(const std::string& url); | 45 bool IsGoogleHomePageUrl(const std::string& url); |
43 | 46 |
44 // True if |url| represents a valid Google search URL. | 47 // True if |url| represents a valid Google search URL. |
45 bool IsGoogleSearchUrl(const std::string& url); | 48 bool IsGoogleSearchUrl(const std::string& url); |
46 | 49 |
47 // True if a build is strictly organic, according to its brand code. | 50 // True if a build is strictly organic, according to its brand code. |
48 bool IsOrganic(const std::string& brand); | 51 bool IsOrganic(const std::string& brand); |
49 | 52 |
50 // True if a build should run as organic during first run. This uses | 53 // True if a build should run as organic during first run. This uses |
(...skipping 12 matching lines...) Expand all Loading... |
63 ~BrandForTesting(); | 66 ~BrandForTesting(); |
64 | 67 |
65 private: | 68 private: |
66 std::string brand_; | 69 std::string brand_; |
67 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); | 70 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); |
68 }; | 71 }; |
69 | 72 |
70 } // namespace google_util | 73 } // namespace google_util |
71 | 74 |
72 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ | 75 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ |
OLD | NEW |