diff options
author | mpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-03 20:10:15 +0000 |
---|---|---|
committer | mpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-03 20:10:15 +0000 |
commit | dd853ce8497beb3a9346172346771f377760620e (patch) | |
tree | dea3597a44a4d76dd2f042a5ede45b8cb095c6ad | |
parent | a3931760d299ba122df3a9d104cd627ed713ab7f (diff) | |
download | chromium_src-dd853ce8497beb3a9346172346771f377760620e.zip chromium_src-dd853ce8497beb3a9346172346771f377760620e.tar.gz chromium_src-dd853ce8497beb3a9346172346771f377760620e.tar.bz2 |
Omnibox: Launch Stop Timer Behavior
Previously, we ran an experiment that caused all autocomplete providers
to stop delivering results after 1.5 seconds. This was caused by the
assumption that results coming in after that length of time are
disruptive, likely causing more harm than benefit. We decided to launch
this experiment. This change turns on that behavior for everyone.
This change also converts the old "use stop timer" field trial code to
a parameterized form, so we can run future experiments with shorter
timeouts.
BUG=
Review URL: https://codereview.chromium.org/117233009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242915 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_controller.cc | 14 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_controller.h | 9 | ||||
-rw-r--r-- | chrome/browser/omnibox/omnibox_field_trial.cc | 14 | ||||
-rw-r--r-- | chrome/browser/omnibox/omnibox_field_trial.h | 13 |
4 files changed, 20 insertions, 30 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_controller.cc b/chrome/browser/autocomplete/autocomplete_controller.cc index 6e57852..35e1ed0 100644 --- a/chrome/browser/autocomplete/autocomplete_controller.cc +++ b/chrome/browser/autocomplete/autocomplete_controller.cc @@ -162,8 +162,7 @@ AutocompleteController::AutocompleteController( keyword_provider_(NULL), search_provider_(NULL), zero_suggest_provider_(NULL), - in_stop_timer_field_trial_( - OmniboxFieldTrial::InStopTimerFieldTrialExperimentGroup()), + stop_timer_duration_(OmniboxFieldTrial::StopTimerFieldTrialDuration()), done_(true), in_start_(false), in_zero_suggest_(false), @@ -649,17 +648,8 @@ void AutocompleteController::StartExpireTimer() { } void AutocompleteController::StartStopTimer() { - if (!in_stop_timer_field_trial_) - return; - - // Amount of time (in ms) between when the user stops typing and - // when we send Stop() to every provider. This is intended to avoid - // the disruptive effect of belated omnibox updates, updates that - // come after the user has had to time to read the whole dropdown - // and doesn't expect it to change. - const int kStopTimeMS = 1500; stop_timer_.Start(FROM_HERE, - base::TimeDelta::FromMilliseconds(kStopTimeMS), + stop_timer_duration_, base::Bind(&AutocompleteController::Stop, base::Unretained(this), false)); diff --git a/chrome/browser/autocomplete/autocomplete_controller.h b/chrome/browser/autocomplete/autocomplete_controller.h index 73ba1ef..3f8839f 100644 --- a/chrome/browser/autocomplete/autocomplete_controller.h +++ b/chrome/browser/autocomplete/autocomplete_controller.h @@ -224,9 +224,12 @@ class AutocompleteController : public AutocompleteProviderListener { // Timer used to tell the providers to Stop() searching for matches. base::OneShotTimer<AutocompleteController> stop_timer_; - // True if the user is in the "stop timer" field trial. If so, the - // controller uses the |stop_timer_|. - const bool in_stop_timer_field_trial_; + // Amount of time (in ms) between when the user stops typing and + // when we send Stop() to every provider. This is intended to avoid + // the disruptive effect of belated omnibox updates, updates that + // come after the user has had to time to read the whole dropdown + // and doesn't expect it to change. + const base::TimeDelta stop_timer_duration_; // True if a query is not currently running. bool done_; 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. |