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

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

Issue 10879043: Centralize logic around Instant modes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Directly call into SearchProvider 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 94112fa213f2009fe7faaafe5f2541de02c8ca48..6f8654517c082617490510d7b70887d1116737a1 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -129,7 +129,8 @@ SearchProvider::SearchProvider(AutocompleteProviderListener* listener,
has_suggested_relevance_(false),
verbatim_relevance_(-1),
have_suggest_results_(false),
- instant_finalized_(false) {
+ instant_finalized_(false),
+ instant_suggest_enabled_(false) {
// Above, we default |suggest_field_trial_group_number_| to the number of
// groups to mean "not in field trial." Field trial groups run from 0 to
// GetSuggestNumberOfGroups() - 1 (inclusive).
@@ -692,7 +693,7 @@ bool SearchProvider::ParseSuggestResults(Value* root_val, bool is_keyword) {
extras->GetList("google:suggesttype", &types);
// Only accept relevance suggestions if Instant is disabled.
- if (!is_keyword && !InstantController::IsEnabled(profile_)) {
+ if (!is_keyword && !instant_suggest_enabled_) {
// Discard this list if its size does not match that of the suggestions.
if (extras->GetList("google:suggestrelevance", &relevances) &&
relevances->GetSize() != results->GetSize())
@@ -1247,5 +1248,5 @@ 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) &&
- (instant_finalized_ || !InstantController::IsEnabled(profile_)));
+ (instant_finalized_ || !instant_suggest_enabled_));
}

Powered by Google App Engine
This is Rietveld 408576698