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

Unified Diff: ash/system/user/tray_user.cc

Issue 14507003: Add tray warning for Locally managed users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
Index: ash/system/user/tray_user.cc
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index 60b0d8dc5bd9fad4ae8bc27089c4fb85161a8ead..aed441be4076c536ccdc3c0c12feae44ec8b1ac0 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -553,12 +553,21 @@ void UserView::AddUserCard(SystemTrayItem* owner,
username->SetHorizontalAlignment(gfx::ALIGN_LEFT);
details->AddChildView(username);
- views::Label* email = new views::Label(UTF8ToUTF16(delegate->GetUserEmail()));
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- email->SetFont(bundle.GetFont(ui::ResourceBundle::SmallFont));
- email->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- email->SetEnabled(false);
- details->AddChildView(email);
+
+ views::Label* additional = new views::Label();
+
+ if (login == ash::user::LOGGED_IN_LOCALLY_MANAGED) {
+ additional->SetText(
+ bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_LOCALLY_MANAGED_LABEL));
+ } else {
+ additional->SetText(UTF8ToUTF16(delegate->GetUserEmail()));
+ }
Daniel Erat 2013/04/29 13:32:57 nit: you can maybe make this a bit shorter by rewr
Denis Kuznetsov (DE-MUC) 2013/04/29 14:14:58 Done.
+
+ additional->SetFont(bundle.GetFont(ui::ResourceBundle::SmallFont));
+ additional->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ additional->SetEnabled(false);
+ details->AddChildView(additional);
user_card_->AddChildView(details);
}

Powered by Google App Engine
This is Rietveld 408576698