Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Side by Side Diff: chrome/browser/instant/instant_field_trial.h

Issue 7337007: Introduce a field trial for Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix onchange handling Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 // Convenience method.
39 static bool IsExperimentGroup(Profile* profile) {
Sheridan Rawlins 2011/07/26 07:07:15 Move this to .cc too
sreeram 2011/07/26 07:36:10 Done.
40 Group group = GetGroup(profile);
41 return group == EXPERIMENT1 || group == EXPERIMENT2;
42 }
43
44 // Returns a string describing the user's group. Can be added to histogram
45 // names, to split histograms by field trial groups.
46 static std::string GetGroupName(Profile* profile);
47
48 private:
49 DISALLOW_IMPLICIT_CONSTRUCTORS(InstantFieldTrial);
50 };
51
52 #endif // CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698