Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / google / google_brand.h
bloba653f41e72bb50375bb961afeb0452c6a06925c6
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.
10 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__
11 #define CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__
13 #include <string>
15 #include "base/basictypes.h"
17 class GURL;
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
35 // method.
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 {
44 public:
45 explicit BrandForTesting(const std::string& brand);
46 ~BrandForTesting();
48 private:
49 std::string brand_;
50 DISALLOW_COPY_AND_ASSIGN(BrandForTesting);
53 } // namespace google_brand
55 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_BRAND_H__