summaryrefslogtreecommitdiffstats
path: root/chrome/browser/omnibox
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/omnibox')
-rw-r--r--chrome/browser/omnibox/omnibox_field_trial.cc14
-rw-r--r--chrome/browser/omnibox/omnibox_field_trial.h13
2 files changed, 12 insertions, 15 deletions
diff --git a/chrome/browser/omnibox/omnibox_field_trial.cc b/chrome/browser/omnibox/omnibox_field_trial.cc
index 93ec15b..98c69dd 100644
--- a/chrome/browser/omnibox/omnibox_field_trial.cc
+++ b/chrome/browser/omnibox/omnibox_field_trial.cc
@@ -62,10 +62,6 @@ const base::FieldTrial::Probability
const base::FieldTrial::Probability
kHUPCreateShorterMatchFieldTrialExperimentFraction = 0;
-// Experiment group names.
-
-const char kStopTimerExperimentGroupName[] = "UseStopTimer";
-
// Field trial IDs.
// Though they are not literally "const", they are set only once, in
// ActivateStaticTrials() below.
@@ -244,9 +240,13 @@ bool OmniboxFieldTrial::InHUPCreateShorterMatchFieldTrialExperimentGroup() {
return group == hup_dont_create_shorter_match_experiment_group;
}
-bool OmniboxFieldTrial::InStopTimerFieldTrialExperimentGroup() {
- return (base::FieldTrialList::FindFullName(kStopTimerFieldTrialName) ==
- kStopTimerExperimentGroupName);
+base::TimeDelta OmniboxFieldTrial::StopTimerFieldTrialDuration() {
+ int stop_timer_ms;
+ if (base::StringToInt(
+ base::FieldTrialList::FindFullName(kStopTimerFieldTrialName),
+ &stop_timer_ms))
+ return base::TimeDelta::FromMilliseconds(stop_timer_ms);
+ return base::TimeDelta::FromMilliseconds(1500);
}
bool OmniboxFieldTrial::HasDynamicFieldTrialGroupPrefix(
diff --git a/chrome/browser/omnibox/omnibox_field_trial.h b/chrome/browser/omnibox/omnibox_field_trial.h
index a75eccc..7389677 100644
--- a/chrome/browser/omnibox/omnibox_field_trial.h
+++ b/chrome/browser/omnibox/omnibox_field_trial.h
@@ -152,14 +152,11 @@ class OmniboxFieldTrial {
// ---------------------------------------------------------
// For the AutocompleteController "stop timer" field trial.
- // Returns whether the user should get the experimental setup or the
- // default setup for this field trial. The experiment group uses
- // a timer in AutocompleteController to tell the providers to stop
- // looking for matches after too much time has passed. In other words,
- // it tries to tell the providers to stop updating the list of suggested
- // matches if updating the matches would probably be disruptive because
- // they're arriving so late.
- static bool InStopTimerFieldTrialExperimentGroup();
+ // Returns the duration to be used for the AutocompleteController's stop
+ // timer. Returns the default value of 1.5 seconds if the stop timer
+ // override experiment isn't active or if parsing the experiment-provided
+ // duration fails.
+ static base::TimeDelta StopTimerFieldTrialDuration();
// ---------------------------------------------------------
// For the ZeroSuggestProvider field trial.