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.
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.
10 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__
11 #define CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__
15 #include "base/basictypes.h"
19 namespace google_brand
{
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
);
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
);
30 // True if a build is strictly organic, according to its brand code.
31 bool IsOrganic(const std::string
& brand
);
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
36 bool IsOrganicFirstRun(const std::string
& brand
);
38 // True if |brand| is an internet cafe brand code.
39 bool IsInternetCafeBrandCode(const std::string
& brand
);
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
{
45 explicit BrandForTesting(const std::string
& brand
);
50 DISALLOW_COPY_AND_ASSIGN(BrandForTesting
);
53 } // namespace google_brand
55 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__