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

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

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/search_provider.h
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h
index ee35c6572c02906eeb4ffda9369ae906bddf4856..213b3cd7dc0e190237efc8a6df5634205ce7db2d 100644
--- a/chrome/browser/autocomplete/search_provider.h
+++ b/chrome/browser/autocomplete/search_provider.h
@@ -69,6 +69,8 @@ class SearchProvider : public BaseSearchProvider {
private:
friend class SearchProviderTest;
FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, CanSendURL);
+ FRIEND_TEST_ALL_PREFIXES(SearchProviderTest,
+ DontInlineAutocompleteAsynchronously);
FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline);
FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineDomainClassify);
FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineSchemeSubstring);
@@ -168,6 +170,7 @@ class SearchProvider : public BaseSearchProvider {
virtual const AutocompleteInput GetInput(bool is_keyword) const OVERRIDE;
virtual SearchSuggestionParser::Results* GetResultsToFill(
bool is_keyword) OVERRIDE;
+ virtual void HandleReceivedResults(bool is_keyword) OVERRIDE;
virtual bool ShouldAppendExtraParams(
const SearchSuggestionParser::SuggestResult& result) const OVERRIDE;
virtual void StopSuggest() OVERRIDE;
@@ -329,9 +332,16 @@ class SearchProvider : public BaseSearchProvider {
scoped_ptr<net::URLFetcher> keyword_fetcher_;
scoped_ptr<net::URLFetcher> default_fetcher_;
- // Results from the default and keyword search providers.
+ // Results from the default and keyword search providers. The orig results
msw 2014/08/14 02:57:23 nit: s/orig/original/ in comments and identifiers.
Mark P 2014/08/15 00:05:56 Now obsolete. (Got rid of the orig members.)
+ // hold the original reply from the server; the non-orig results are the
+ // ones that should be used for most purposes. They may have been modified
+ // in some ways from the orig results, for instance, to demote a brand
+ // new suggestion that would be inline autocompleted. (We don't want
+ // asynchronous inline autocompletions.)
SearchSuggestionParser::Results default_results_;
SearchSuggestionParser::Results keyword_results_;
+ SearchSuggestionParser::Results orig_default_results_;
msw 2014/08/14 02:57:23 Why do we need a copy of the originals? Can't we m
Mark P 2014/08/15 00:05:56 Removed copy of the originals. Good idea.
+ SearchSuggestionParser::Results orig_keyword_results_;
GURL current_page_url_;

Powered by Google App Engine
This is Rietveld 408576698