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

Unified Diff: components/omnibox/search_suggestion_parser.h

Issue 481693004: Omnibox: Prevent Asynchronous Suggestions from Changing Default Match (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « components/omnibox/search_provider.cc ('k') | components/omnibox/search_suggestion_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/search_suggestion_parser.h
diff --git a/components/omnibox/search_suggestion_parser.h b/components/omnibox/search_suggestion_parser.h
index db7f1f4d56da0dd646afee7af1fff32f7c5a5edf..8e8ba3deb9ce031eddccdb3ae81249178c3a9920 100644
--- a/components/omnibox/search_suggestion_parser.h
+++ b/components/omnibox/search_suggestion_parser.h
@@ -55,6 +55,13 @@ class SearchSuggestionParser {
AutocompleteMatchType::Type type() const { return type_; }
int relevance() const { return relevance_; }
void set_relevance(int relevance) { relevance_ = relevance; }
+ bool received_after_last_keystroke() const {
+ return received_after_last_keystroke_;
+ }
+ void set_received_after_last_keystroke(
+ bool received_after_last_keystroke) {
+ received_after_last_keystroke_ = received_after_last_keystroke;
+ }
bool relevance_from_server() const { return relevance_from_server_; }
void set_relevance_from_server(bool relevance_from_server) {
@@ -91,6 +98,11 @@ class SearchSuggestionParser {
// there.
bool relevance_from_server_;
+ // Whether this result was received asynchronously after the last
+ // keystroke, otherwise it must have come from prior cached results
+ // or from a synchronous provider.
+ bool received_after_last_keystroke_;
+
// Optional deletion URL provided with suggestions. Fetching this URL
// should result in some reasonable deletion behaviour on the server,
// e.g. deleting this term out of a user's server-side search history.
« no previous file with comments | « components/omnibox/search_provider.cc ('k') | components/omnibox/search_suggestion_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698