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

Unified Diff: ash/desktop_background/desktop_background_controller.h

Issue 10375010: Implement user selected wallpaper feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/desktop_background/desktop_background_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b31a21464120ef1ecdff7e6f8e64f0ecb3c23329..a531001f57bc6ea46f4680bdd34db04bb71517b6 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -22,7 +22,7 @@ class UserWallpaperDelegate {
// Gets the index of user selected wallpaper.
virtual const int GetUserWallpaperIndex() = 0;
- // Open the set wallpaper page in the browser.
+ // Opens the set wallpaper page in the browser.
virtual void OpenSetWallpaperPage() = 0;
// Returns true if user can open set wallpaper page. Only guest user returns
@@ -30,8 +30,8 @@ class UserWallpaperDelegate {
virtual bool CanOpenSetWallpaperPage() = 0;
};
-// A class to listen for login and desktop background change events and set the
-// corresponding default wallpaper in Aura shell.
+// Loads selected desktop wallpaper from file system asynchronously and updates
+// background layer if loaded successfully.
class ASH_EXPORT DesktopBackgroundController {
public:
enum BackgroundMode {
@@ -42,39 +42,44 @@ class ASH_EXPORT DesktopBackgroundController {
DesktopBackgroundController();
virtual ~DesktopBackgroundController();
- // Get the desktop background mode.
+ // Gets the desktop background mode.
BackgroundMode desktop_background_mode() const {
return desktop_background_mode_;
}
- // Load default wallpaper at |index| asynchronously and set to current
+ // Loads default wallpaper at |index| asynchronously and sets to current
// wallpaper after loaded.
void SetDefaultWallpaper(int index);
- // Cancel the current wallpaper loading operation.
+ // Sets the user selected custom wallpaper. Called when user selected a file
+ // from file system or changed the layout of wallpaper.
+ void SetCustomWallpaper(const SkBitmap& wallpaper, WallpaperLayout layout);
+
+ // Cancels the current wallpaper loading operation.
void CancelPendingWallpaperOperation();
- // Load logged in user wallpaper asynchronously and set to current wallpaper
+ // Loads logged in user wallpaper asynchronously and sets to current wallpaper
// after loaded.
void SetLoggedInUserWallpaper();
- // Sets the desktop background to solid color mode and create a solid color
+ // Sets the desktop background to solid color mode and creates a solid color
// layout.
void SetDesktopBackgroundSolidColorMode();
private:
- // An operation to asynchronously load wallpaper.
+ // An operation to asynchronously loads 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
+ // Sets the desktop background to image mode and creates a new background
+ // widget with user selected wallpaper or default wallpaper. Deletes the old
// widget if any.
void SetDesktopBackgroundImageMode(scoped_refptr<WallpaperOperation> wo);
- // Default wallpapper loaded, set the background mode to image mode.
+ // Creates a new background widget and sets the background mode to image mode.
+ // Called after wallpaper loaded successfully.
void OnWallpaperLoadCompleted(scoped_refptr<WallpaperOperation> wo);
- // Create an empty wallpaper. Some tests require a wallpaper widget is ready
+ // Creates 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
« no previous file with comments | « no previous file | ash/desktop_background/desktop_background_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698