OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 |
| 12 class Profile; |
| 13 |
| 14 // This class manages the Instant field trial. Each user is in exactly one of |
| 15 // three field trial groups: Inactive, Control or Experiment. |
| 16 // - Inactive users are those who have played with the Instant option in the |
| 17 // Preferences page, or those for whom group policy provides an override, or |
| 18 // those with an incognito profile, etc. The field trial is inactive for such |
| 19 // users, so their Instant preference setting is respected. |
| 20 // - Control and Experiment are all the other users, i.e., those who have never |
| 21 // touched the Preferences option. Some percentage of these users are chosen |
| 22 // into the Experiment group and get Instant enabled automatically. The rest |
| 23 // fall into the Control group; for them, Instant remains disabled by default. |
| 24 // - Control and Experiment are further split into two subgroups each, in order |
| 25 // to detect bias between them (when analyzing metrics). The subgroups are |
| 26 // treated identically for all other purposes. |
| 27 class InstantFieldTrial { |
| 28 public: |
| 29 enum Group { |
| 30 INACTIVE, |
| 31 CONTROL1, |
| 32 CONTROL2, |
| 33 EXPERIMENT1, |
| 34 EXPERIMENT2, |
| 35 }; |
| 36 static Group GetGroup(Profile* profile); |
| 37 |
| 38 // Check if the group is either of the two experiment subgroups. |
| 39 static bool IsExperimentGroup(Profile* profile); |
| 40 |
| 41 // Returns a string describing the user's group. Can be added to histogram |
| 42 // names, to split histograms by field trial groups. |
| 43 static std::string GetGroupName(Profile* profile); |
| 44 |
| 45 private: |
| 46 DISALLOW_IMPLICIT_CONSTRUCTORS(InstantFieldTrial); |
| 47 }; |
| 48 |
| 49 #endif // CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_ |
OLD | NEW |