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

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

Issue 10860068: Fix Omnibox search provider's confusing internal variable semantics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/search_provider.cc
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index d5507f67e4206b2731b5a54540fad147c32dca7f..29bddfda0e2e2bba4e8563e0ba41a17a5dcac73c 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -504,12 +504,6 @@ void SearchProvider::StartOrStopSuggestQuery(bool minimal_changes) {
if (input_.matches_requested() != AutocompleteInput::ALL_MATCHES)
return;
- // We'll have at least one pending fetch. Set it to 1 now, but the value is
- // correctly set in Run. As Run isn't invoked immediately we need to set this
- // now, else we won't think we're waiting on results from the server when we
- // really are.
- suggest_results_pending_ = 1;
-
// Kick off a timer that will start the URL fetch if it completes before
// the user types another character. Requests may be delayed to avoid
// flooding the server with requests that are likely to be thrown away later
@@ -1242,8 +1236,8 @@ AutocompleteMatch SearchProvider::NavigationToMatch(
}
void SearchProvider::UpdateDone() {
- // We're done when there are no more suggest queries pending (this is set to 1
- // when the timer is started) and we're not waiting on instant.
- done_ = ((suggest_results_pending_ == 0) &&
+ // We're done when the timer isn't running and there are no suggest queries
msw 2012/08/21 18:30:27 grammar nit: lists of 3+ clauses use comma(s) and
Mark P 2012/08/21 19:13:41 Done.
+ // pending and we're not waiting on instant.
+ done_ = (!timer_.IsRunning() && (suggest_results_pending_ == 0) &&
(instant_finalized_ || !InstantController::IsEnabled(profile_)));
}

Powered by Google App Engine
This is Rietveld 408576698