Index: chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
index 911c26a55a8830909ee01af95c301f1be2a05462..b80fa3c5382721dad29304d4727b0546086cb1fe 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
@@ -699,13 +699,21 @@ void OmniboxResultView::OnPaint(gfx::Canvas* canvas) { |
if (match_.answer) { |
base::string16 text; |
description_rendertext_ = CreateRenderText(text); |
- for (const SuggestionAnswer::TextField& textfield : |
+ for (const SuggestionAnswer::TextField& text_field : |
match_.answer->second_line().text_fields()) |
- AppendAnswerText(textfield); |
- if (match_.answer->second_line().additional_text()) |
- AppendAnswerText(*match_.answer->second_line().additional_text()); |
- if (match_.answer->second_line().status_text()) |
- AppendAnswerText(*match_.answer->second_line().status_text()); |
+ AppendAnswerText(text_field.text(), text_field.type()); |
+ if (match_.answer->second_line().additional_text()) { |
Peter Kasting
2015/03/24 01:05:35
Nit: Briefer, seems a bit more readable:
dschuyler
2015/03/24 01:26:47
Done.
|
+ AppendAnswerText( |
+ base::ASCIIToUTF16(" ") + |
+ match_.answer->second_line().additional_text()->text(), |
+ match_.answer->second_line().additional_text()->type()); |
+ } |
+ if (match_.answer->second_line().status_text()) { |
+ AppendAnswerText( |
+ base::ASCIIToUTF16(" ") + |
+ match_.answer->second_line().status_text()->text(), |
+ match_.answer->second_line().status_text()->type()); |
+ } |
} else if (!match_.description.empty()) { |
description_rendertext_ = CreateClassifiedRenderText( |
match_.description, match_.description_class, true); |
@@ -755,12 +763,12 @@ int OmniboxResultView::GetContentLineHeight() const { |
GetTextHeight() + (kMinimumTextVerticalPadding * 2)); |
} |
-void OmniboxResultView::AppendAnswerText( |
- const SuggestionAnswer::TextField& text_field) { |
+void OmniboxResultView::AppendAnswerText(const base::string16& text, |
+ int text_type) { |
int offset = description_rendertext_->text().length(); |
- gfx::Range range(offset, offset + text_field.text().length()); |
- description_rendertext_->AppendText(text_field.text()); |
- const TextStyle& text_style = GetTextStyle(text_field.type()); |
+ gfx::Range range(offset, offset + text.length()); |
+ description_rendertext_->AppendText(text); |
+ const TextStyle& text_style = GetTextStyle(text_type); |
// TODO(dschuyler): follow up on the problem of different font sizes within |
// one RenderText. |
description_rendertext_->SetFontList( |