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

Unified Diff: components/omnibox/base_search_provider.cc

Issue 599273002: Revert of Revert of [AiS] Merge answers into highest-scoring result (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@top-hit
Patch Set: 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 | « components/components_tests.gyp ('k') | components/omnibox/base_search_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/base_search_provider.cc
diff --git a/components/omnibox/base_search_provider.cc b/components/omnibox/base_search_provider.cc
index 76792e5b816f47456a77f92b5ee46892cc1f8cf3..4e199308528ec64dd471b435cd98ab304023b6e7 100644
--- a/components/omnibox/base_search_provider.cc
+++ b/components/omnibox/base_search_provider.cc
@@ -420,6 +420,17 @@
i.first->second.RecordAdditionalInfo(kSuggestMetadataKey, metadata);
}
}
+ // Copy over answer data from lower-ranking item, if necessary.
+ // This depends on the lower-ranking item always being added last - see
+ // use of push_back above.
+ AutocompleteMatch& more_relevant_match = i.first->second;
+ const AutocompleteMatch& less_relevant_match =
+ more_relevant_match.duplicate_matches.back();
+ if (!less_relevant_match.answer_type.empty() &&
+ more_relevant_match.answer_type.empty()) {
+ more_relevant_match.answer_type = less_relevant_match.answer_type;
+ more_relevant_match.answer_contents = less_relevant_match.answer_contents;
+ }
}
}
« no previous file with comments | « components/components_tests.gyp ('k') | components/omnibox/base_search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698