Chromium Code Reviews| 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 ff20defe86b522ec68391cabf79198da13e1c853..4bf086b15fda9bf71c037631d4d6a0778c3a84c5 100644 |
| --- a/ash/common/system/user/user_card_view.cc |
| +++ b/ash/common/system/user/user_card_view.cc |
| @@ -11,7 +11,7 @@ |
| #include "ash/common/ash_view_ids.h" |
| #include "ash/common/login_status.h" |
| #include "ash/common/media_controller.h" |
| -#include "ash/common/session/session_state_delegate.h" |
| +#include "ash/common/session/session_controller.h" |
| #include "ash/common/system/tray/system_tray_controller.h" |
| #include "ash/common/system/tray/system_tray_delegate.h" |
| #include "ash/common/system/tray/tray_constants.h" |
| @@ -63,8 +63,9 @@ views::View* CreateUserAvatarView(LoginStatus login_status, int user_index) { |
| gfx::CreateVectorIcon(kSystemMenuGuestIcon, kMenuIconColor); |
| image_view->SetImage(icon, icon.size()); |
| } else { |
| - SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); |
| - image_view->SetImage(delegate->GetUserInfo(user_index)->GetImage(), |
| + SessionController* controller = WmShell::Get()->session_controller(); |
| + image_view->SetImage(gfx::ImageSkia::CreateFrom1xBitmap( |
|
James Cook
2017/03/17 17:14:35
ditto re high dpi
xiyuan
2017/03/17 22:52:02
Acknowledged.
|
| + controller->GetUserSession(user_index)->avatar), |
| gfx::Size(kTrayItemSize, kTrayItemSize)); |
| } |
| @@ -118,10 +119,8 @@ PublicAccountUserDetails::PublicAccountUserDetails(int max_width) |
| // Retrieve the user's display name and wrap it with markers. |
| // Note that since this is a public account it always has to be the primary |
| // user. |
| - base::string16 display_name = WmShell::Get() |
| - ->GetSessionStateDelegate() |
| - ->GetUserInfo(0) |
| - ->GetDisplayName(); |
| + base::string16 display_name = base::UTF8ToUTF16( |
| + WmShell::Get()->session_controller()->GetUserSession(0)->display_name); |
| base::RemoveChars(display_name, kDisplayNameMark, &display_name); |
| display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0]; |
| // Retrieve the domain managing the device and wrap it with markers. |
| @@ -395,11 +394,12 @@ void UserCardView::AddPublicModeUserContent(int max_width) { |
| void UserCardView::AddUserContent(views::BoxLayout* layout, |
| LoginStatus login_status) { |
| AddChildView(CreateUserAvatarView(login_status, user_index_)); |
| - SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); |
| + SessionController* controller = WmShell::Get()->session_controller(); |
| base::string16 user_name_string = |
| login_status == LoginStatus::GUEST |
| ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_GUEST_LABEL) |
| - : delegate->GetUserInfo(user_index_)->GetDisplayName(); |
| + : base::UTF8ToUTF16( |
| + controller->GetUserSession(user_index_)->display_name); |
| user_name_ = new views::Label(user_name_string); |
| user_name_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| TrayPopupItemStyle user_name_style( |
| @@ -418,7 +418,7 @@ void UserCardView::AddUserContent(views::BoxLayout* layout, |
| WmShell::Get()->system_tray_delegate()->IsUserSupervised() |
| ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) |
| : base::UTF8ToUTF16( |
| - delegate->GetUserInfo(user_index_)->GetDisplayEmail()); |
| + controller->GetUserSession(user_index_)->display_email); |
| } |
| user_email->SetText(user_email_string); |
| user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); |