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 // This namespace provides various helpers and state relating to Google Chrome 6 // distributions (such as RLZ), and specifically relating to the brand of the 7 // current install. Brands are codes that are assigned to partners for tracking 8 // distribution information. 9 10 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__ 11 #define CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__ 12 13 #include <string> 14 15 #include "base/basictypes.h" 16 17 class GURL; 18 19 namespace google_brand { 20 21 // Returns in |brand| the brand code or distribution tag that has been 22 // assigned to a partner. Returns false if the information is not available. 23 bool GetBrand(std::string* brand); 24 25 // Returns in |brand| the reactivation brand code or distribution tag 26 // that has been assigned to a partner for reactivating a dormant chrome 27 // install. Returns false if the information is not available. 28 bool GetReactivationBrand(std::string* brand); 29 30 // True if a build is strictly organic, according to its brand code. 31 bool IsOrganic(const std::string& brand); 32 33 // True if a build should run as organic during first run. This uses 34 // a slightly different set of brand codes from the standard IsOrganic 35 // method. 36 bool IsOrganicFirstRun(const std::string& brand); 37 38 // True if |brand| is an internet cafe brand code. 39 bool IsInternetCafeBrandCode(const std::string& brand); 40 41 // This class is meant to be used only from test code, and sets the brand 42 // code returned by the function GetBrand() above while the object exists. 43 class BrandForTesting { 44 public: 45 explicit BrandForTesting(const std::string& brand); 46 ~BrandForTesting(); 47 48 private: 49 std::string brand_; 50 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); 51 }; 52 53 } // namespace google_brand 54 55 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__ 56