Instant Extended: Prevent inline autocomplete of Search suggestions. This only impacts the local omnibox (for online, this provider is not used).
BUG=235064
Review URL: https://chromiumcodereview.appspot.com/14369006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196936 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index be43ae1..8d921c8 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -1326,6 +1326,14 @@
int accepted_suggestion,
bool is_keyword,
MatchMap* map) {
+ // With Instant Extended, we never want to inline autocomplete search queries
+ // -- they should always use grey text if they are to autocomplete at all. So
+ // we clamp non-verbatim results to just below the verbatim score to ensure
+ // that none of them are inline autocompleted.
+ if ((type != AutocompleteMatch::SEARCH_WHAT_YOU_TYPED) &&
+ chrome::IsInstantExtendedAPIEnabled()) {
+ relevance = std::min(kNonURLVerbatimRelevance - 1, relevance);
+ }
AutocompleteMatch match(this, relevance, false, type);
std::vector<size_t> content_param_offsets;
// Bail out now if we don't actually have a valid provider.