From 28ef4d486f7de3e20d3d9fc3a161704676cbca48 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Wed, 26 Mar 2014 18:34:27 +0000 Subject: [PATCH] Munge descriptions of search matches even when they come from the shortcuts provider. The shortcuts backend will still end up storing inconsistent descriptions -- e.g. "Google Search" or the empty string, depending on which line the user opens -- but it won't matter, because these will all get reset consistently when the controller displays them. BUG=320060 TEST=none R=mpearson@chromium.org Review URL: https://codereview.chromium.org/205383007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259638 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_controller.cc | 5 +---- chrome/browser/autocomplete/keyword_provider.cc | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/chrome/browser/autocomplete/autocomplete_controller.cc b/chrome/browser/autocomplete/autocomplete_controller.cc index 2a9ee17653d4..08d70ac9845c 100644 --- a/chrome/browser/autocomplete/autocomplete_controller.cc +++ b/chrome/browser/autocomplete/autocomplete_controller.cc @@ -511,10 +511,7 @@ void AutocompleteController::UpdateKeywordDescriptions( base::string16 last_keyword; for (AutocompleteResult::iterator i(result->begin()); i != result->end(); ++i) { - if ((i->provider->type() == AutocompleteProvider::TYPE_KEYWORD && - !i->keyword.empty()) || - (i->provider->type() == AutocompleteProvider::TYPE_SEARCH && - AutocompleteMatch::IsSearchType(i->type))) { + if (AutocompleteMatch::IsSearchType(i->type)) { if (AutocompleteMatchHasCustomDescription(*i)) continue; i->description.clear(); diff --git a/chrome/browser/autocomplete/keyword_provider.cc b/chrome/browser/autocomplete/keyword_provider.cc index 2878ed76d450..13c9920725e7 100644 --- a/chrome/browser/autocomplete/keyword_provider.cc +++ b/chrome/browser/autocomplete/keyword_provider.cc @@ -592,8 +592,6 @@ void KeywordProvider::Observe(int type, match->contents.assign(base::UTF8ToUTF16(suggestion.description)); match->contents_class = extensions::StyleTypesToACMatchClassifications(suggestion); - match->description.clear(); - match->description_class.clear(); } done_ = true; -- 2.11.4.GIT