Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_controller.cc |
| diff --git a/chrome/browser/autocomplete/autocomplete_controller.cc b/chrome/browser/autocomplete/autocomplete_controller.cc |
| index 9a24d2ce554a5ef15c364e384cc732930c2b9082..622b8743fcde2c4d88e041c0c015c8900293ace3 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_controller.cc |
| +++ b/chrome/browser/autocomplete/autocomplete_controller.cc |
| @@ -300,20 +300,7 @@ void AutocompleteController::Start(const AutocompleteInput& input) { |
| } |
| void AutocompleteController::Stop(bool clear_result) { |
| - for (Providers::const_iterator i(providers_.begin()); i != providers_.end(); |
|
Mark P
2015/03/05 20:43:18
This is a direct move below except for revising th
|
| - ++i) { |
| - (*i)->Stop(clear_result); |
| - } |
| - |
| - expire_timer_.Stop(); |
| - stop_timer_.Stop(); |
| - done_ = true; |
| - if (clear_result && !result_.empty()) { |
| - result_.Reset(); |
| - // NOTE: We pass in false since we're trying to only clear the popup, not |
| - // touch the edit... this is all a mess and should be cleaned up :( |
| - NotifyChanged(false); |
| - } |
| + StopHelper(clear_result, false); |
| } |
| void AutocompleteController::OnOmniboxFocused(const AutocompleteInput& input) { |
| @@ -663,7 +650,25 @@ void AutocompleteController::StartExpireTimer() { |
| void AutocompleteController::StartStopTimer() { |
| stop_timer_.Start(FROM_HERE, |
| stop_timer_duration_, |
| - base::Bind(&AutocompleteController::Stop, |
| + base::Bind(&AutocompleteController::StopHelper, |
| base::Unretained(this), |
| - false)); |
| + false, true)); |
| +} |
| + |
| +void AutocompleteController::StopHelper(bool clear_result, |
| + bool user_inactivity_timer) { |
| + for (Providers::const_iterator i(providers_.begin()); i != providers_.end(); |
| + ++i) { |
| + (*i)->Stop(clear_result, user_inactivity_timer); |
| + } |
| + |
| + expire_timer_.Stop(); |
| + stop_timer_.Stop(); |
| + done_ = true; |
| + if (clear_result && !result_.empty()) { |
| + result_.Reset(); |
| + // NOTE: We pass in false since we're trying to only clear the popup, not |
| + // touch the edit... this is all a mess and should be cleaned up :( |
| + NotifyChanged(false); |
| + } |
| } |