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

Unified Diff: ash/desktop_background/desktop_background_controller.h

Issue 10207030: Asynchronously load wallpapers when user pod is selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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 b603fbde546a71f3d1ec5cc661419252259394d7..92536b6d887b20729f09de54b36480baae54408d 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -9,6 +9,7 @@
#include "ash/ash_export.h"
#include "ash/desktop_background/desktop_background_resources.h"
#include "base/basictypes.h"
+#include "base/memory/weak_ptr.h"
class SkBitmap;
@@ -46,6 +47,18 @@ class ASH_EXPORT DesktopBackgroundController {
return desktop_background_mode_;
}
+ // Load default wallpaper at |index| asynchronously and set to current
+ // wallpaper after loaded.
+ void SetDefaultWallpaper(int index);
+
+ // Load guest wallpaper asynchronously and set to current wallpaper after
+ // loaded.
+ void SetGuestWallpaper();
+
+ // Load logged in user wallpaper asynchronously and set to current wallpaper
+ // after loaded.
+ void SetLoggedInUserWallpaper();
+
// Sets the desktop background to image mode and create a new background
// widget with user selected wallpaper or default wallpaper. Delete the old
// widget if any.
@@ -56,8 +69,18 @@ class ASH_EXPORT DesktopBackgroundController {
void SetDesktopBackgroundSolidColorMode();
private:
+ // Start to load default wallpaper asynchronously.
+ void OnWallpaperLoadStarted(int index);
+
+ // Default wallpapper loaded, set the background mode to image mode.
+ void OnWallpaperLoadCompleted();
+
// Can change at runtime.
BackgroundMode desktop_background_mode_;
+ const SkBitmap* wallpaper_;
+ ImageLayout layout_;
+ int previous_index_;
+ base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController);
};

Powered by Google App Engine
This is Rietveld 408576698