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

Unified Diff: ash/desktop_background/desktop_background_controller.h

Issue 11415015: Remove use of index in wallpaper picker code and some refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Please review this patch Created 8 years, 1 month 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
Index: ash/desktop_background/desktop_background_controller.h
diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h
index 23302c8bbffa2ee5d9614a2e261afed3125a045e..4d4a5be8b8ec3979bc6ce81e37812db4a5fe2e8f 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -6,7 +6,6 @@
#define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_
#include "ash/ash_export.h"
-#include "ash/desktop_background/desktop_background_resources.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -24,6 +23,31 @@ class RootWindow;
namespace ash {
+enum WallpaperLayout {
+ CENTER,
sky 2012/11/19 22:21:19 For enums that exist in the ash namespace they nee
bshe 2012/11/20 00:33:59 Done.
+ CENTER_CROPPED,
+ STRETCH,
+ TILE,
+};
+
+enum WallpaperResolution {
+ LARGE,
+ SMALL
+};
+
+const SkColor kLoginWallpaperColor = 0xFEFEFE;
+
+// Encapsulates wallpaper infomation needed by desktop background controller.
+struct ASH_EXPORT WallpaperInfo {
+ int idr;
+ WallpaperLayout layout;
+};
+
+ASH_EXPORT extern const WallpaperInfo kDefaultLargeWallpaper;
+ASH_EXPORT extern const WallpaperInfo kDefaultSmallWallpaper;
+ASH_EXPORT extern const WallpaperInfo kGuestLargeWallpaper;
+ASH_EXPORT extern const WallpaperInfo kGuestSmallWallpaper;
+
// The width and height of small/large resolution wallpaper. When screen size is
// smaller than |kSmallWallpaperMaxWidth| and |kSmallWallpaperMaxHeight|, the
// small resolution wallpaper should be used. Otherwise, uses the large
@@ -64,21 +88,16 @@ class ASH_EXPORT DesktopBackgroundController : public aura::WindowObserver {
// is no image, e.g. background is solid color.
gfx::ImageSkia GetCurrentWallpaperImage();
+ // Gets the IDR of current wallpaper. Returns -1 if current wallpaper is not
+ // a builtin wallpaper.
+ int GetWallpaperIDR() const;
+
// Initialize root window's background.
void OnRootWindowAdded(aura::RootWindow* root_window);
- // Loads default wallpaper at |index| asynchronously but does not set the
- // loaded image to current wallpaper. Resource bundle will cache the loaded
- // image.
- void CacheDefaultWallpaper(int index);
-
- // Loads default wallpaper at |index| asynchronously and sets to current
- // wallpaper after loaded.
- void SetDefaultWallpaper(int index);
-
- // Forces to reload the current default wallpaper. A different resolution
- // wallpaper maybe loaded.
- void ReloadDefaultWallpaper();
+ // Loads builtin wallpaper asynchronously and sets to current wallpaper after
+ // loaded.
+ void SetDefaultWallpaper(WallpaperInfo info);
sky 2012/11/19 22:21:19 const WallpaperInfo&
bshe 2012/11/20 00:33:59 Done.
// Sets the user selected custom wallpaper. Called when user selected a file
// from file system or changed the layout of wallpaper.

Powered by Google App Engine
This is Rietveld 408576698