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

Unified Diff: components/omnibox/search_provider.h

Issue 603683004: [AiS] Remove answer contents from all matches other than the first. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test, respond to comments 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 | « chrome/browser/autocomplete/search_provider_unittest.cc ('k') | components/omnibox/search_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/search_provider.h
diff --git a/components/omnibox/search_provider.h b/components/omnibox/search_provider.h
index c8307c38db2663f36dc4fc8ee6a2bc38f7de96d6..12b921991ce6bc2dec39fa86a0a15b81992fdac6 100644
--- a/components/omnibox/search_provider.h
+++ b/components/omnibox/search_provider.h
@@ -11,6 +11,9 @@
#ifndef COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_
#define COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_
+#include <string>
+#include <vector>
+
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
@@ -85,6 +88,7 @@ class SearchProvider : public BaseSearchProvider,
FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestQueryUsesToken);
FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SessionToken);
FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, AnswersCache);
+ FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, RemoveExtraAnswers);
FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, GetDestinationURL);
FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, ClearPrefetchedResults);
FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, SetPrefetchQuery);
@@ -231,6 +235,10 @@ class SearchProvider : public BaseSearchProvider,
// Converts the parsed results to a set of AutocompleteMatches, |matches_|.
void ConvertResultsToAutocompleteMatches();
+ // Remove answer contents from each match in |matches| other than the first
+ // that appears.
+ static void RemoveExtraAnswers(ACMatches* matches);
+
// Returns an iterator to the first match in |matches_| which might
// be chosen as default.
ACMatches::const_iterator FindTopMatch() const;
« no previous file with comments | « chrome/browser/autocomplete/search_provider_unittest.cc ('k') | components/omnibox/search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698