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

Unified 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: Added opt-out histogram 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_field_trial.h
diff --git a/chrome/browser/instant/instant_field_trial.h b/chrome/browser/instant/instant_field_trial.h
new file mode 100644
index 0000000000000000000000000000000000000000..6dfafd761d098d21c02d76c035d306ed6af2e89c
--- /dev/null
+++ b/chrome/browser/instant/instant_field_trial.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_
+#define CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+class Profile;
+
+// This class manages the Instant field trial. Each user is in exactly one of
+// three field trial groups: Inactive, Control or Experiment.
+// - Inactive users are those who have played with the Instant option in the
+// Preferences page, or those for whom group policy provides an override, or
+// those with an incognito profile, etc. The field trial is inactive for such
+// users, so their Instant preference setting is respected.
+// - Control and Experiment are all the other users, i.e., those who have never
+// touched the Preferences option. Some percentage of these users are chosen
+// into the Experiment group and get Instant enabled automatically. The rest
+// fall into the Control group; for them, Instant remains disabled by default.
+// - Control and Experiment are further split into two subgroups each, in order
+// to detect bias between them (when analyzing metrics). The subgroups are
+// treated identically for all other purposes.
+class InstantFieldTrial {
+ public:
+ enum Group {
+ INACTIVE,
+ CONTROL1,
+ CONTROL2,
+ EXPERIMENT1,
+ EXPERIMENT2,
+ };
+ static Group GetGroup(Profile* profile);
+
+ // Convenience method.
+ static bool IsExperimentGroup(Profile* profile) {
+ Group group = GetGroup(profile);
+ return group == EXPERIMENT1 || group == EXPERIMENT2;
+ }
+
+ // Returns a string describing the user's group. Can be added to histogram
+ // names, to split histograms by field trial groups.
+ static std::string GetGroupName(Profile* profile);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(InstantFieldTrial);
+};
+
+#endif // CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_

Powered by Google App Engine
This is Rietveld 408576698