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

Side by Side Diff: trunk/src/ash/frame/frame_util.cc

Issue 260783002: Revert 267158 "CleanUp: Introduce UserInfo. Move session_state s..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/ash/frame/custom_frame_view_ash.cc ('k') | trunk/src/ash/root_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/frame/frame_util.h" 5 #include "ash/frame/frame_util.h"
6 6
7 #include "ash/session/session_state_delegate.h" 7 #include "ash/session_state_delegate.h"
8 #include "ash/session/user_info.h"
9 #include "ash/shell.h" 8 #include "ash/shell.h"
10 #include "grit/ash_resources.h" 9 #include "grit/ash_resources.h"
11 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/gfx/image/image_skia.h" 11 #include "ui/gfx/image/image_skia.h"
13 #include "ui/gfx/image/image_skia_operations.h" 12 #include "ui/gfx/image/image_skia_operations.h"
14 13
15 namespace ash { 14 namespace ash {
16 15
17 gfx::Image GetAvatarImageForContext(content::BrowserContext* context) { 16 gfx::Image GetAvatarImageForContext(content::BrowserContext* context) {
18 static const gfx::ImageSkia* holder = 17 static const gfx::ImageSkia* holder =
19 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 18 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
20 IDR_AVATAR_HOLDER); 19 IDR_AVATAR_HOLDER);
21 static const gfx::ImageSkia* holder_mask = 20 static const gfx::ImageSkia* holder_mask =
22 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 21 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
23 IDR_AVATAR_HOLDER_MASK); 22 IDR_AVATAR_HOLDER_MASK);
24 gfx::ImageSkia user_image = Shell::GetInstance() 23 gfx::ImageSkia user_image =
25 ->session_state_delegate() 24 Shell::GetInstance()->session_state_delegate()->GetUserImage(context);
26 ->GetUserInfo(context)
27 ->GetImage();
28 gfx::ImageSkia resized = gfx::ImageSkiaOperations::CreateResizedImage( 25 gfx::ImageSkia resized = gfx::ImageSkiaOperations::CreateResizedImage(
29 user_image, skia::ImageOperations::RESIZE_BEST, holder->size()); 26 user_image, skia::ImageOperations::RESIZE_BEST, holder->size());
30 gfx::ImageSkia masked = 27 gfx::ImageSkia masked =
31 gfx::ImageSkiaOperations::CreateMaskedImage(resized, *holder_mask); 28 gfx::ImageSkiaOperations::CreateMaskedImage(resized, *holder_mask);
32 gfx::ImageSkia result = 29 gfx::ImageSkia result =
33 gfx::ImageSkiaOperations::CreateSuperimposedImage(*holder, masked); 30 gfx::ImageSkiaOperations::CreateSuperimposedImage(*holder, masked);
34 return gfx::Image(result); 31 return gfx::Image(result);
35 } 32 }
36 33
37 } // namespace ash 34 } // namespace ash
38 35
OLDNEW
« no previous file with comments | « trunk/src/ash/frame/custom_frame_view_ash.cc ('k') | trunk/src/ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698