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

Unified Diff: ash/desktop_background/wallpaper_resizer.cc

Issue 215293003: Move all wallpaper file loading and decoding from DesktopBackgroundController to WallpaperManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clang debug build. Created 6 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/desktop_background/wallpaper_resizer.h ('k') | ash/shell/content_client/shell_browser_main_parts.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/wallpaper_resizer.cc
diff --git a/ash/desktop_background/wallpaper_resizer.cc b/ash/desktop_background/wallpaper_resizer.cc
index 06d8c97da7d53c54b0e06d40c72c8488314c314c..46497b2c1c84b6b45a7d36c0acbdee4e7dfd540e 100644
--- a/ash/desktop_background/wallpaper_resizer.cc
+++ b/ash/desktop_background/wallpaper_resizer.cc
@@ -93,6 +93,8 @@ void Resize(SkBitmap orig_bitmap,
} // namespace
+const int kInvalidResourceID = -1;
+
// static
uint32_t WallpaperResizer::GetImageId(const gfx::ImageSkia& image) {
const gfx::ImageSkiaRep& image_rep = image.GetRepresentation(1.0f);
@@ -102,9 +104,11 @@ uint32_t WallpaperResizer::GetImageId(const gfx::ImageSkia& image) {
WallpaperResizer::WallpaperResizer(int image_resource_id,
const gfx::Size& target_size,
WallpaperLayout layout)
- : image_(*(ui::ResourceBundle::GetSharedInstance().
- GetImageNamed(image_resource_id).ToImageSkia())),
+ : image_(*(ui::ResourceBundle::GetSharedInstance()
+ .GetImageNamed(image_resource_id)
+ .ToImageSkia())),
original_image_id_(GetImageId(image_)),
+ resource_id_(image_resource_id),
target_size_(target_size),
layout_(layout),
weak_ptr_factory_(this) {
@@ -116,6 +120,7 @@ WallpaperResizer::WallpaperResizer(const gfx::ImageSkia& image,
WallpaperLayout layout)
: image_(image),
original_image_id_(GetImageId(image_)),
+ resource_id_(kInvalidResourceID),
target_size_(target_size),
layout_(layout),
weak_ptr_factory_(this) {
« no previous file with comments | « ash/desktop_background/wallpaper_resizer.h ('k') | ash/shell/content_client/shell_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698