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

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: Update SearchProviderTest.Navsuggest with test case. 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
Index: chrome/browser/autocomplete/search_provider.cc
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index d6d34d7065aaa76392d61df85747d722eabdd935..ac844810e8c2e7f04ba03ce0b801bcf60ff70465 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -657,12 +657,13 @@ void SearchProvider::ConvertResultsToAutocompleteMatches() {
}
void SearchProvider::AddNavigationResultsToMatches(
- const NavigationResults& navigation_results,
+ NavigationResults navigation_results,
bool is_keyword) {
+ std::stable_sort(navigation_results.begin(), navigation_results.end(),
Peter Kasting 2012/05/14 20:29:19 Use std::max_element() instead of sorting and then
msw 2012/05/15 01:00:29 Done.
+ CompareScoredResults());
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.
+ // TODO(kochi|msw): Add more navigational results if they get more
+ // meaningful relevance values; see http://b/1170574.
matches_.push_back(
NavigationToMatch(navigation_results.front(), is_keyword));
}
« no previous file with comments | « chrome/browser/autocomplete/search_provider.h ('k') | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698