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

Unified Diff: components/omnibox/browser/suggestion_answer.cc

Issue 2091473003: Factor parsing "ln=" to SuggestionAnswer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/browser/suggestion_answer.cc
diff --git a/components/omnibox/browser/suggestion_answer.cc b/components/omnibox/browser/suggestion_answer.cc
index e6fb0be85730d95305eafc5fee507f13739ae090..2564aeedeb87f296d1f7642c7c75d8d5387b1203 100644
--- a/components/omnibox/browser/suggestion_answer.cc
+++ b/components/omnibox/browser/suggestion_answer.cc
@@ -182,7 +182,8 @@ SuggestionAnswer::SuggestionAnswer() : type_(-1) {}
SuggestionAnswer::SuggestionAnswer(const SuggestionAnswer& answer)
: first_line_(answer.first_line_),
second_line_(answer.second_line_),
- type_(answer.type_) {}
+ type_(answer.type_),
+ second_line_size_(answer.second_line_size_) {}
groby-ooo-7-16 2016/06/23 20:49:27 Since this is just a default copy ctor, let's do t
Kevin Bailey 2016/06/23 21:49:22 sgtm
Kevin Bailey 2016/06/28 15:59:32 Done.
SuggestionAnswer::~SuggestionAnswer() {}
@@ -206,6 +207,13 @@ std::unique_ptr<SuggestionAnswer> SuggestionAnswer::ParseAnswer(
!ImageLine::ParseImageLine(second_line_json, &result->second_line_))
return nullptr;
+ for (const auto& text_field : result->second_line_.text_fields()) {
+ if (text_field.has_num_lines()) {
+ result->second_line_size_ = text_field.num_lines();
+ break;
+ }
+ }
+
return result;
}

Powered by Google App Engine
This is Rietveld 408576698