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

Unified Diff: components/omnibox/base_search_provider.cc

Issue 584653004: [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 | « no previous file | no next file » | 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 dfc26a59a207d966a01a27a120d3e35e4ece90bc..a0db8f34cb1a70471adb54d449a706455208b17e 100644
--- a/components/omnibox/base_search_provider.cc
+++ b/components/omnibox/base_search_provider.cc
@@ -420,6 +420,14 @@ void BaseSearchProvider::AddMatchToMap(
i.first->second.RecordAdditionalInfo(kSuggestMetadataKey, metadata);
}
}
+ // Copy over answer data from lower-ranking item, if necessary.
+ const AutocompleteMatch& less_relevant_match =
+ i.first->second.duplicate_matches.back();
Mark P 2014/09/19 18:56:38 This makes me a little nervous because you're depe
groby-ooo-7-16 2014/09/22 05:49:25 Comment added. I think it's fairly clear, but call
+ if (!less_relevant_match.answer_type.empty()) {
+ DCHECK(i.first->second.answer_type.empty());
Mark P 2014/09/19 18:56:38 Why is this true? Why can't multiple equivalent s
groby-ooo-7-16 2014/09/22 05:49:25 Because suggestions are only provided by the searc
+ i.first->second.answer_type = less_relevant_match.answer_type;
+ i.first->second.answer_contents = less_relevant_match.answer_contents;
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698