Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // Some Google related utility functions. | |
|
Peter Kasting
2014/06/04 20:32:16
Can you clarify and expand this comment? This is
blundell
2014/06/05 09:21:43
Done.
| |
| 6 | |
| 7 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__ | |
| 8 #define CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__ | |
| 9 | |
| 10 #include <string> | |
| 11 | |
| 12 #include "base/basictypes.h" | |
| 13 | |
| 14 class GURL; | |
| 15 | |
| 16 // This namespace provides various helpers and state relating to Google Chrome | |
| 17 // distributions (such as RLZ). | |
|
Peter Kasting
2014/06/04 20:32:16
Nit: I'd drop this and say anything necessary in t
blundell
2014/06/05 09:21:43
Done.
| |
| 18 namespace google_brand { | |
| 19 | |
| 20 // Returns in |brand| the brand code or distribution tag that has been | |
| 21 // assigned to a partner. Returns false if the information is not available. | |
| 22 bool GetBrand(std::string* brand); | |
| 23 | |
| 24 // Returns in |brand| the reactivation brand code or distribution tag | |
| 25 // that has been assigned to a partner for reactivating a dormant chrome | |
| 26 // install. Returns false if the information is not available. | |
| 27 bool GetReactivationBrand(std::string* brand); | |
| 28 | |
| 29 // True if a build is strictly organic, according to its brand code. | |
| 30 bool IsOrganic(const std::string& brand); | |
| 31 | |
| 32 // True if a build should run as organic during first run. This uses | |
| 33 // a slightly different set of brand codes from the standard IsOrganic | |
| 34 // method. | |
| 35 bool IsOrganicFirstRun(const std::string& brand); | |
| 36 | |
| 37 // True if |brand| is an internet cafe brand code. | |
| 38 bool IsInternetCafeBrandCode(const std::string& brand); | |
| 39 | |
| 40 // This class is meant to be used only from test code, and sets the brand | |
| 41 // code returned by the function GetBrand() above while the object exists. | |
| 42 class BrandForTesting { | |
| 43 public: | |
| 44 explicit BrandForTesting(const std::string& brand); | |
| 45 ~BrandForTesting(); | |
| 46 | |
| 47 private: | |
| 48 std::string brand_; | |
| 49 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); | |
| 50 }; | |
| 51 | |
| 52 } // namespace google_brand | |
| 53 | |
| 54 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__ | |
| OLD | NEW |