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

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

Issue 197773004: Move avatar holder code to ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 6 years, 9 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/session_state_delegate_stub.cc ('k') | ash/test/test_session_state_delegate.h » ('j') | 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 bd01bbe12ddeae957fe6e182d11c970c97be5728..8384b9e5ae23ab55f7d95fec152c64298ed5df21 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -921,10 +921,12 @@ views::View* UserView::CreateIconForUserCard(user::LoginStatus login) {
GetImageNamed(IDR_AURA_UBER_TRAY_GUEST_ICON).ToImageSkia(),
gfx::Size(kUserIconSize, kUserIconSize));
} else {
- icon->SetImage(
- Shell::GetInstance()->session_state_delegate()->
- GetUserImage(multiprofile_index_),
- gfx::Size(kUserIconSize, kUserIconSize));
+ SessionStateDelegate* delegate =
+ Shell::GetInstance()->session_state_delegate();
+ content::BrowserContext* context = delegate->GetBrowserContextByIndex(
+ multiprofile_index_);
+ icon->SetImage(delegate->GetUserImage(context),
+ gfx::Size(kUserIconSize, kUserIconSize));
}
return icon;
}
@@ -1332,10 +1334,10 @@ void TrayUser::UpdateAvatarImage(user::LoginStatus status) {
int icon_size = switches::UseAlternateShelfLayout() ?
kUserIconLargeSize : kUserIconSize;
- avatar_->SetImage(
- Shell::GetInstance()->session_state_delegate()->GetUserImage(
- GetTrayIndex()),
- gfx::Size(icon_size, icon_size));
+ content::BrowserContext* context = session_state_delegate->
+ GetBrowserContextByIndex(GetTrayIndex());
+ avatar_->SetImage(session_state_delegate->GetUserImage(context),
+ gfx::Size(icon_size, icon_size));
// Unit tests might come here with no images for some users.
if (avatar_->size().IsEmpty())
« no previous file with comments | « ash/session_state_delegate_stub.cc ('k') | ash/test/test_session_state_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698