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

Unified Diff: chrome/browser/instant/instant_field_trial.cc

Issue 7461075: Revert 94073 (broke a ton of tests) - Introduce a field trial for Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « chrome/browser/instant/instant_field_trial.h ('k') | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_field_trial.cc
===================================================================
--- chrome/browser/instant/instant_field_trial.cc (revision 94076)
+++ chrome/browser/instant/instant_field_trial.cc (working copy)
@@ -1,47 +0,0 @@
-// 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.
-
-#include "chrome/browser/instant/instant_field_trial.h"
-
-#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/pref_names.h"
-
-// static
-InstantFieldTrial::Group InstantFieldTrial::GetGroup(Profile* profile) {
- if (profile->IsOffTheRecord())
- return INACTIVE;
-
- const PrefService* prefs = profile->GetPrefs();
- if (!prefs ||
- prefs->GetBoolean(prefs::kInstantEnabledOnce) ||
- prefs->IsManagedPreference(prefs::kInstantEnabled)) {
- return INACTIVE;
- }
-
- const int random = prefs->GetInteger(prefs::kInstantFieldTrialRandomDraw);
- return random < 4500 ? CONTROL1 : // 45%
- random < 9000 ? CONTROL2 : // 45%
- random < 9500 ? EXPERIMENT1 // 5%
- : EXPERIMENT2; // 5%
-}
-
-// static
-bool InstantFieldTrial::IsExperimentGroup(Profile* profile) {
- Group group = GetGroup(profile);
- return group == EXPERIMENT1 || group == EXPERIMENT2;
-}
-
-// static
-std::string InstantFieldTrial::GetGroupName(Profile* profile) {
- switch (GetGroup(profile)) {
- case INACTIVE: return "InstantInactive";
- case CONTROL1: return "InstantControl1";
- case CONTROL2: return "InstantControl2";
- case EXPERIMENT1: return "InstantExperiment1";
- case EXPERIMENT2: return "InstantExperiment2";
- }
- NOTREACHED();
- return "InstantUnknown";
-}
« no previous file with comments | « chrome/browser/instant/instant_field_trial.h ('k') | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698