Chromium Code Reviews| Index: ash/system/tray/hover_highlight_view.cc |
| diff --git a/ash/system/tray/hover_highlight_view.cc b/ash/system/tray/hover_highlight_view.cc |
| index 9df8b65220fa81c92ba89ccc264a8bcfec8ff6d5..c1b4e6b793e0e364efc0dc3d68502309a8f01e50 100644 |
| --- a/ash/system/tray/hover_highlight_view.cc |
| +++ b/ash/system/tray/hover_highlight_view.cc |
| @@ -57,17 +57,15 @@ void HoverHighlightView::SetRightViewVisible(bool visible) { |
| void HoverHighlightView::SetSubText(const base::string16& sub_text) { |
| DCHECK(text_label_); |
| - DCHECK(!sub_text.empty()); |
| - if (!sub_text_label_) { |
| + if (!sub_text.empty()) { |
| sub_text_label_ = TrayPopupUtils::CreateDefaultLabel(); |
|
stevenjb
2017/05/04 17:25:58
You still need the if (!sub_text_label_) test here
|
| + sub_text_label_->SetText(sub_text); |
| + TrayPopupItemStyle sub_style(TrayPopupItemStyle::FontStyle::CAPTION); |
| + sub_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE); |
| + sub_style.SetupLabel(sub_text_label_); |
| tri_view_->AddView(TriView::Container::CENTER, sub_text_label_); |
| } |
| - |
| - TrayPopupItemStyle sub_style(TrayPopupItemStyle::FontStyle::CAPTION); |
| - sub_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE); |
| - sub_style.SetupLabel(sub_text_label_); |
| - sub_text_label_->SetText(sub_text); |
| } |
| void HoverHighlightView::AddIconAndLabel(const gfx::ImageSkia& image, |