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

Unified Diff: ash/common/system/user/user_card_view.cc

Issue 2564623002: MD CrOS Shelf - fix alignment of guest user name in shelf bubble. (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/user/user_card_view.cc
diff --git a/ash/common/system/user/user_card_view.cc b/ash/common/system/user/user_card_view.cc
index f222058ccccc7021cbe3f1d74ae3eb131d363cc0..157d07e5f1bc83f8a2cc78dc52b59d85ec209609 100644
--- a/ash/common/system/user/user_card_view.cc
+++ b/ash/common/system/user/user_card_view.cc
@@ -564,9 +564,8 @@ void UserCardView::AddUserContentMd(views::BoxLayout* layout,
auto user_email = new views::Label();
base::string16 user_email_string;
if (login_status != LoginStatus::GUEST) {
- SystemTrayDelegate* tray_delegate = WmShell::Get()->system_tray_delegate();
user_email_string =
- tray_delegate->IsUserSupervised()
+ WmShell::Get()->system_tray_delegate()->IsUserSupervised()
? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL)
: base::UTF8ToUTF16(
delegate->GetUserInfo(user_index_)->GetDisplayEmail());
@@ -574,6 +573,8 @@ void UserCardView::AddUserContentMd(views::BoxLayout* layout,
user_email->SetText(user_email_string);
user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT);
user_email_style.SetupLabel(user_email);
+ user_email->SetVisible(!user_email_string.empty());
+ user_email->set_collapse_when_hidden(true);
views::View* stack_of_labels = new views::View;
AddChildView(stack_of_labels);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698