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

Unified Diff: components/omnibox/autocomplete_match.cc

Issue 669573005: Add a class to parse answer json. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments, fix a copy bug Created 6 years, 2 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: components/omnibox/autocomplete_match.cc
diff --git a/components/omnibox/autocomplete_match.cc b/components/omnibox/autocomplete_match.cc
index 558ed93c417838a47d571751bb9febce2e7b83d4..efe770e61e932f428515539f673a9737376f9c98 100644
--- a/components/omnibox/autocomplete_match.cc
+++ b/components/omnibox/autocomplete_match.cc
@@ -12,6 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "components/omnibox/autocomplete_provider.h"
+#include "components/omnibox/suggestion_answer.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "grit/components_scaled_resources.h"
@@ -79,6 +80,7 @@ AutocompleteMatch::AutocompleteMatch(const AutocompleteMatch& match)
description_class(match.description_class),
answer_contents(match.answer_contents),
answer_type(match.answer_type),
+ answer(SuggestionAnswer::copy(match.answer.get())),
groby-ooo-7-16 2014/10/30 20:28:29 match.answer should suffice - here and elsewhere.
Justin Donnelly 2014/10/30 21:38:03 It doesn't seem to (I tried and I don't see what i
Peter Kasting 2014/10/30 22:09:37 Yeah, it wouldn't unless you made copy() take a co
groby-ooo-7-16 2014/10/30 22:13:58 Sorry - was thinking of scoped_nsobject
transition(match.transition),
is_history_what_you_typed_match(match.is_history_what_you_typed_match),
type(match.type),
@@ -116,6 +118,7 @@ AutocompleteMatch& AutocompleteMatch::operator=(
description_class = match.description_class;
answer_contents = match.answer_contents;
answer_type = match.answer_type;
+ answer = SuggestionAnswer::copy(match.answer.get());
transition = match.transition;
is_history_what_you_typed_match = match.is_history_what_you_typed_match;
type = match.type;

Powered by Google App Engine
This is Rietveld 408576698