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

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

Issue 471673002: Omnibox: Prevent Asynchronous Suggestions from Changing Default Match (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add clarifying comment Created 6 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/base_search_provider.cc
diff --git a/chrome/browser/autocomplete/base_search_provider.cc b/chrome/browser/autocomplete/base_search_provider.cc
index f93318df111d1886b0a8b6954c0a82f352d7acaf..7e3a693689871f87da05328710e80e8fb397e125 100644
--- a/chrome/browser/autocomplete/base_search_provider.cc
+++ b/chrome/browser/autocomplete/base_search_provider.cc
@@ -257,7 +257,8 @@ AutocompleteMatch BaseSearchProvider::CreateSearchSuggestion(
match.fill_into_edit.assign(base::ASCIIToUTF16("?"));
if (suggestion.from_keyword_provider())
match.fill_into_edit.append(match.keyword + base::char16(' '));
- if (!input.prevent_inline_autocomplete() &&
+ if (!suggestion.never_allowed_to_be_default_match() &&
+ !input.prevent_inline_autocomplete() &&
StartsWith(suggestion.suggestion(), input.text(), false)) {
match.inline_autocompletion =
suggestion.suggestion().substr(input.text().length());
@@ -396,6 +397,8 @@ void BaseSearchProvider::OnURLFetchComplete(const net::URLFetcher* source) {
results_updated = data.get() && ParseSuggestResults(
*data.get(), is_keyword, GetResultsToFill(is_keyword));
+ if (results_updated)
+ HandleReceivedResults(is_keyword);
msw 2014/08/14 02:57:22 Is HandleReceivedResults really needed if we call
Mark P 2014/08/15 00:05:56 Huh. I guess not.
}
UpdateMatches();
@@ -516,6 +519,9 @@ bool BaseSearchProvider::StoreSuggestionResponse(
return false;
}
+void BaseSearchProvider::HandleReceivedResults(bool is_keyword) {
+}
+
void BaseSearchProvider::ModifyProviderInfo(
metrics::OmniboxEventProto_ProviderInfo* provider_info) const {
}

Powered by Google App Engine
This is Rietveld 408576698