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

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

Issue 462963002: [AiS] Reuse previous answer for verbatim. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: 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);
}
« 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