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

Unified Diff: chrome/browser/autocomplete/autocomplete_controller.cc

Issue 985503002: Omnibox - Make Omnibox Extensions Ignore Stop() Calls Due to User Idleness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make unit tests compile Created 5 years, 9 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
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..65a53c7c6320361234fa5960cb9b0f76eb33135d 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();
- ++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 due_to_user_inactivity) {
+ for (Providers::const_iterator i(providers_.begin()); i != providers_.end();
+ ++i) {
+ (*i)->Stop(clear_result, due_to_user_inactivity);
+ }
+
+ 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);
+ }
}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_controller.h ('k') | chrome/browser/autocomplete/history_url_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698