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

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

Issue 10381121: Add SearchProvider's most relevant NavigationResult to |matches_|. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use max_element instead of sorting results. Created 8 years, 7 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 | « no previous file | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/search_provider.cc
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 2c92d50f5469eced906122843f466236223b53cd..637ba719297d7509d3c2327df6fd5d2f2168768d 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -660,11 +660,13 @@ void SearchProvider::AddNavigationResultsToMatches(
const NavigationResults& navigation_results,
bool is_keyword) {
if (!navigation_results.empty()) {
- // TODO(kochi): http://b/1170574 We add only one results for navigational
- // suggestions. If we can get more useful information about the score,
- // consider adding more results.
- matches_.push_back(
- NavigationToMatch(navigation_results.front(), is_keyword));
+ // TODO(kochi|msw): Add more navigational results if they get more
+ // meaningful relevance values; see http://b/1170574.
+ NavigationResults::const_iterator result(
+ std::max_element(navigation_results.begin(),
+ navigation_results.end(),
+ CompareScoredResults()));
+ matches_.push_back(NavigationToMatch(*result, is_keyword));
}
}
« no previous file with comments | « no previous file | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698