Index: chrome/browser/autocomplete/search_provider.cc |
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc |
index 04b37a5a6092bfdf1c01e92a91d7a21963d3a863..b5c3bc6d764ff0964ec1af339d9854aa7b59cf89 100644 |
--- a/chrome/browser/autocomplete/search_provider.cc |
+++ b/chrome/browser/autocomplete/search_provider.cc |
@@ -733,12 +733,27 @@ void SearchProvider::ConvertResultsToAutocompleteMatches() { |
if (verbatim_relevance > 0) { |
const base::string16& trimmed_verbatim = |
base::CollapseWhitespace(input_.text(), false); |
+ |
+ // Verbatim results don't get suggestions and hence, answers. |
Mark P
2014/08/12 20:57:29
This feels like the wrong place to do this. By do
groby-ooo-7-16
2014/08/12 22:09:20
But I can't add it anywhere else - the answer need
Mark P
2014/08/12 23:17:43
Good point.
msw
2014/08/13 19:01:04
Why don't verbatim results get suggestions? Isn't
Mark P
2014/08/13 19:42:22
I'll answer on behalf of groby@: the server does n
|
+ // Scan previous matches if the last answer-bearing suggestion matches |
msw
2014/08/13 19:01:04
Why not just check |last_answer_seen_| instead of
groby-ooo-7-16
2014/08/13 20:07:17
Because
1) last_answer_seen_ is only the query te
Mark P
2014/08/13 20:12:27
If this is happening, can you add to the bug that'
groby-ooo-7-16
2014/08/13 23:39:21
The cache still can't hold the answers content. Th
Mark P
2014/08/14 03:29:44
When the user ceases to edit something in the omni
|
+ // verbatim, and if so, copy over answer contents. |
+ base::string16 answer_contents; |
+ base::string16 answer_type; |
+ for (ACMatches::iterator it = matches_.begin(); it != matches_.end(); |
+ ++it) { |
+ if (!it->answer_contents.empty() && |
+ it->fill_into_edit == trimmed_verbatim) { |
+ answer_contents = it->answer_contents; |
+ answer_type = it->answer_type; |
+ break; |
+ } |
+ } |
+ |
SearchSuggestionParser::SuggestResult verbatim( |
trimmed_verbatim, AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, |
- trimmed_verbatim, base::string16(), base::string16(), base::string16(), |
- base::string16(), std::string(), std::string(), false, |
- verbatim_relevance, relevance_from_server, false, |
- trimmed_verbatim); |
+ trimmed_verbatim, base::string16(), base::string16(), answer_contents, |
+ answer_type, std::string(), std::string(), false, verbatim_relevance, |
+ relevance_from_server, false, trimmed_verbatim); |
AddMatchToMap(verbatim, std::string(), did_not_accept_default_suggestion, |
false, &map); |
} |