| 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..b31a21464120ef1ecdff7e6f8e64f0ecb3c23329 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,19 +47,51 @@ class ASH_EXPORT DesktopBackgroundController {
|
| return desktop_background_mode_;
|
| }
|
|
|
| - // 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.
|
| - void SetDesktopBackgroundImageMode();
|
| + // Load default wallpaper at |index| asynchronously and set to current
|
| + // wallpaper after loaded.
|
| + void SetDefaultWallpaper(int index);
|
| +
|
| + // Cancel the current wallpaper loading operation.
|
| + void CancelPendingWallpaperOperation();
|
| +
|
| + // Load logged in user wallpaper asynchronously and set to current wallpaper
|
| + // after loaded.
|
| + void SetLoggedInUserWallpaper();
|
|
|
| // Sets the desktop background to solid color mode and create a solid color
|
| // layout.
|
| void SetDesktopBackgroundSolidColorMode();
|
|
|
| private:
|
| + // An operation to asynchronously load wallpaper.
|
| + class WallpaperOperation;
|
| +
|
| + // 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.
|
| + void SetDesktopBackgroundImageMode(scoped_refptr<WallpaperOperation> wo);
|
| +
|
| + // Default wallpapper loaded, set the background mode to image mode.
|
| + void OnWallpaperLoadCompleted(scoped_refptr<WallpaperOperation> wo);
|
| +
|
| + // Create an empty wallpaper. Some tests require a wallpaper widget is ready
|
| + // when running. However, the wallpaper widgets are now created asynchronously
|
| + // . If loading a real wallpaper, there are cases that these tests crash
|
| + // because the required widget is not ready. This function synchronously
|
| + // creates an empty widget for those tests to prevent crashes. An example test
|
| + // is SystemGestureEventFilterTest.ThreeFingerSwipe.
|
| + void CreateEmptyWallpaper();
|
| +
|
| // Can change at runtime.
|
| BackgroundMode desktop_background_mode_;
|
|
|
| + // The previous successfully loaded wallpaper.
|
| + int previous_index_;
|
| +
|
| + scoped_refptr<WallpaperOperation> wallpaper_op_;
|
| +
|
| + base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController);
|
| };
|
|
|
|
|