Index: chrome/browser/instant/instant_controller.cc |
=================================================================== |
--- chrome/browser/instant/instant_controller.cc (revision 94076) |
+++ chrome/browser/instant/instant_controller.cc (working copy) |
@@ -7,11 +7,9 @@ |
#include "base/command_line.h" |
#include "base/message_loop.h" |
#include "base/metrics/histogram.h" |
-#include "base/rand_util.h" |
#include "build/build_config.h" |
#include "chrome/browser/autocomplete/autocomplete_match.h" |
#include "chrome/browser/instant/instant_delegate.h" |
-#include "chrome/browser/instant/instant_field_trial.h" |
#include "chrome/browser/instant/instant_loader.h" |
#include "chrome/browser/instant/instant_loader_manager.h" |
#include "chrome/browser/instant/promo_counter.h" |
@@ -51,10 +49,9 @@ |
last_transition_type_(PageTransition::LINK), |
ALLOW_THIS_IN_INITIALIZER_LIST(destroy_factory_(this)) { |
PrefService* service = profile->GetPrefs(); |
- if (service && |
- InstantFieldTrial::GetGroup(profile) == InstantFieldTrial::INACTIVE) { |
- // kInstantEnabledOnce was added after instant, set it now to make sure it |
- // is correctly set. |
+ if (service) { |
+ // kInstantWasEnabledOnce was added after instant, set it now to make sure |
+ // it is correctly set. |
service->SetBoolean(prefs::kInstantEnabledOnce, true); |
} |
} |
@@ -76,9 +73,6 @@ |
prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, |
false, |
PrefService::UNSYNCABLE_PREF); |
- prefs->RegisterIntegerPref(prefs::kInstantFieldTrialRandomDraw, |
- base::RandInt(0, 9999), |
- PrefService::UNSYNCABLE_PREF); |
PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); |
} |
@@ -106,8 +100,7 @@ |
// static |
bool InstantController::IsEnabled(Profile* profile) { |
PrefService* prefs = profile->GetPrefs(); |
- return prefs->GetBoolean(prefs::kInstantEnabled) || |
- InstantFieldTrial::IsExperimentGroup(profile); |
+ return prefs->GetBoolean(prefs::kInstantEnabled); |
} |
// static |
@@ -120,11 +113,11 @@ |
if (!service) |
return; |
- service->SetBoolean(prefs::kInstantEnabledOnce, true); |
service->SetBoolean(prefs::kInstantEnabled, true); |
service->SetBoolean(prefs::kInstantConfirmDialogShown, true); |
service->SetInt64(prefs::kInstantEnabledTime, |
base::Time::Now().ToInternalValue()); |
+ service->SetBoolean(prefs::kInstantEnabledOnce, true); |
} |
// static |
@@ -142,12 +135,6 @@ |
delta.InMinutes(), 1, 60 * 24 * 10, 50); |
} |
- if (InstantFieldTrial::IsExperimentGroup(profile)) { |
- UMA_HISTOGRAM_COUNTS( |
- "Instant.FieldTrialOptOut." + InstantFieldTrial::GetGroupName(profile), |
- 1); |
- } |
- |
service->SetBoolean(prefs::kInstantEnabledOnce, true); |
service->SetBoolean(prefs::kInstantEnabled, false); |
} |
@@ -390,10 +377,8 @@ |
void InstantController::OnAutocompleteGotFocus( |
TabContentsWrapper* tab_contents) { |
CommandLine* cl = CommandLine::ForCurrentProcess(); |
- if (!cl->HasSwitch(switches::kPreloadInstantSearch) && |
- !InstantFieldTrial::IsExperimentGroup(tab_contents->profile())) { |
+ if (!cl->HasSwitch(switches::kPreloadInstantSearch)) |
return; |
- } |
if (is_active_) |
return; |
@@ -720,8 +705,7 @@ |
return PREVIEW_CONDITION_BLACKLISTED; |
const CommandLine* cl = CommandLine::ForCurrentProcess(); |
- if ((cl->HasSwitch(switches::kRestrictInstantToSearch) || |
- InstantFieldTrial::IsExperimentGroup(tab_contents_->profile())) && |
+ if (cl->HasSwitch(switches::kRestrictInstantToSearch) && |
match.type != AutocompleteMatch::SEARCH_WHAT_YOU_TYPED && |
match.type != AutocompleteMatch::SEARCH_HISTORY && |
match.type != AutocompleteMatch::SEARCH_SUGGEST && |