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

Unified Diff: chrome/browser/ui/ash/session_util.cc

Issue 2910773002: cros: CustomFrameViewAsh avatar icon from a window prop (Closed)
Patch Set: add test Created 3 years, 7 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 | « chrome/browser/ui/ash/session_util.h ('k') | ui/aura/client/aura_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/session_util.cc
diff --git a/chrome/browser/ui/ash/session_util.cc b/chrome/browser/ui/ash/session_util.cc
index ca38dc9cea6d581b9807896c3a06823ecfe8a7fd..531c0b9e226fcc023e450fe8306117bdbd4d887a 100644
--- a/chrome/browser/ui/ash/session_util.cc
+++ b/chrome/browser/ui/ash/session_util.cc
@@ -44,6 +44,11 @@ bool CanShowWindowForUser(
}
gfx::ImageSkia GetAvatarImageForContext(content::BrowserContext* context) {
+ return GetAvatarImageForUser(chromeos::ProfileHelper::Get()->GetUserByProfile(
+ Profile::FromBrowserContext(context)));
+}
+
+gfx::ImageSkia GetAvatarImageForUser(const user_manager::User* user) {
static const gfx::ImageSkia* holder =
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_AVATAR_HOLDER);
@@ -51,11 +56,7 @@ gfx::ImageSkia GetAvatarImageForContext(content::BrowserContext* context) {
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_AVATAR_HOLDER_MASK);
- gfx::ImageSkia user_image =
- chromeos::ProfileHelper::Get()
- ->GetUserByProfile(Profile::FromBrowserContext(context))
- ->GetImage();
-
+ gfx::ImageSkia user_image = user->GetImage();
gfx::ImageSkia resized = gfx::ImageSkiaOperations::CreateResizedImage(
user_image, skia::ImageOperations::RESIZE_BEST, holder->size());
gfx::ImageSkia masked =
« no previous file with comments | « chrome/browser/ui/ash/session_util.h ('k') | ui/aura/client/aura_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698