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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm

Issue 2091473003: Factor parsing "ln=" to SuggestionAnswer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorder lines 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_result_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
index 541d5f59177b2b7e7fcfc4cc219828ac80a31393..693ef769066bf8a0d1a04a57c0c23069142b8bb1 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
@@ -268,14 +268,6 @@ NSAttributedString* CreateAnswerString(const base::string16& text,
return result.autorelease();
}
-int ParseNumLines(const SuggestionAnswer::TextFields& text_fields) {
- for (const SuggestionAnswer::TextField& text_field : text_fields) {
- if (text_field.has_num_lines() && text_field.num_lines() > 1)
- return text_field.num_lines();
- }
- return 1;
-}
-
NSAttributedString* CreateAnswerLine(const SuggestionAnswer::ImageLine& line,
BOOL is_dark_theme) {
base::scoped_nsobject<NSMutableAttributedString> answer_string(
@@ -444,7 +436,7 @@ NSAttributedString* CreateClassifiedAttributedString(
[CreateAnswerLine(match.answer->first_line(), isDarkTheme) retain];
description_ =
[CreateAnswerLine(match.answer->second_line(), isDarkTheme) retain];
- max_lines_ = ParseNumLines(match.answer->second_line().text_fields());
+ max_lines_ = match.answer->second_line().num_text_lines();
} else {
contents_ = [CreateClassifiedAttributedString(
match.contents, ContentTextColor(isDarkTheme), match.contents_class,
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698