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

Unified Diff: ash/system/tray/hover_highlight_view.cc

Issue 2844933003: [Ash] Disallow calling HoverHighlightView::SetSubText() with an empty string (Closed)
Patch Set: Created 3 years, 8 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 | « ash/system/tray/hover_highlight_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e96272b6761e84dc7390fca4249f3bf68588ab77..b973129f9c89d8ac3b0b465bee891e6bb77b4ba6 100644
--- a/ash/system/tray/hover_highlight_view.cc
+++ b/ash/system/tray/hover_highlight_view.cc
@@ -56,12 +56,16 @@ void HoverHighlightView::SetRightViewVisible(bool visible) {
}
void HoverHighlightView::SetSubText(const base::string16& sub_text) {
+ if (sub_text.empty())
mohsen 2017/04/27 19:39:37 We should either disallow empty string altogether
tdanderson 2017/04/27 20:52:16 Done.
+ return;
+
DCHECK(text_label_);
if (!sub_text_label_) {
sub_text_label_ = TrayPopupUtils::CreateDefaultLabel();
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_);
« no previous file with comments | « ash/system/tray/hover_highlight_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698