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

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: more comment cleanup after rebasing 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 c2a68bf25e707f497d7829b8bcf25fea662e34b4..3a7a93faa507caa14bd748b4f58214802f75221d 100644
--- a/chrome/browser/autocomplete/base_search_provider.cc
+++ b/chrome/browser/autocomplete/base_search_provider.cc
@@ -255,7 +255,10 @@ AutocompleteMatch BaseSearchProvider::CreateSearchSuggestion(
match.fill_into_edit.assign(base::ASCIIToUTF16("?"));
if (suggestion.from_keyword_provider())
match.fill_into_edit.append(match.keyword + base::char16(' '));
+ // We only allow inlinable navsuggestions that were received before the
msw 2014/08/15 21:27:59 Do we actually want to check received_after_last_k
Mark P 2014/08/15 22:09:22 Line 246 is fine. Verbatim matches are always all
msw 2014/08/15 23:31:10 Ah, I get it now, I mistakenly thought that markin
+ // last keystroke because we don't want asynchronous inline autocompletions.
if (!input.prevent_inline_autocomplete() &&
+ !suggestion.received_after_last_keystroke() &&
(!in_keyword_mode || suggestion.from_keyword_provider()) &&
StartsWith(suggestion.suggestion(), input.text(), false)) {
match.inline_autocompletion =
« no previous file with comments | « no previous file | chrome/browser/autocomplete/search_provider.h » ('j') | chrome/browser/autocomplete/search_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698