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

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

Issue 10200006: ash: Refresh the tray items, instead of recreating them, when login status changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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/user/tray_user.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/user/tray_user.cc
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index 0895d3bfacaea69bbeab863febd15b937ce19fcd..f0977e5b380280b86c05b67c8bd81b563b40d0ef 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -262,15 +262,8 @@ TrayUser::~TrayUser() {
views::View* TrayUser::CreateTrayView(user::LoginStatus status) {
avatar_.reset(new tray::RoundedImageView(kTrayRoundedBorderRadius));
- if (status != user::LOGGED_IN_NONE && status != user::LOGGED_IN_KIOSK &&
- status != user::LOGGED_IN_GUEST) {
- avatar_->SetImage(
- ash::Shell::GetInstance()->tray_delegate()->GetUserImage(),
- gfx::Size(kUserIconSize, kUserIconSize));
- } else {
- avatar_->SetVisible(false);
- }
avatar_->set_border(views::Border::CreateEmptyBorder(0, 6, 0, 0));
+ UpdateAfterLoginStatusChange(status);
return avatar_.get();
}
@@ -297,6 +290,18 @@ void TrayUser::DestroyDefaultView() {
void TrayUser::DestroyDetailedView() {
}
+void TrayUser::UpdateAfterLoginStatusChange(user::LoginStatus status) {
+ if (status != user::LOGGED_IN_NONE && status != user::LOGGED_IN_KIOSK &&
+ status != user::LOGGED_IN_GUEST) {
+ avatar_->SetImage(
+ ash::Shell::GetInstance()->tray_delegate()->GetUserImage(),
+ gfx::Size(kUserIconSize, kUserIconSize));
+ avatar_->SetVisible(true);
+ } else {
+ avatar_->SetVisible(false);
+ }
+}
+
void TrayUser::OnUserUpdate() {
avatar_->SetImage(
ash::Shell::GetInstance()->tray_delegate()->GetUserImage(),
« no previous file with comments | « ash/system/user/tray_user.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698