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

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.h

Issue 10375010: Implement user selected wallpaper feature. (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: chrome/browser/chromeos/login/user_manager_impl.h
diff --git a/chrome/browser/chromeos/login/user_manager_impl.h b/chrome/browser/chromeos/login/user_manager_impl.h
index bb6523fcb172b9bd6d65f8612e72f27658505c80..34db78f291f0c72bf3afe80315a526785345ae1e 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.h
+++ b/chrome/browser/chromeos/login/user_manager_impl.h
@@ -73,8 +73,13 @@ class UserManagerImpl : public UserManager,
int image_index) OVERRIDE;
virtual void SaveUserImage(const std::string& username,
const SkBitmap& image) OVERRIDE;
+ virtual void SetLoggedInUserCustomWallpaperLayout(
+ ash::WallpaperLayout layout) OVERRIDE;
virtual void SaveUserImageFromFile(const std::string& username,
const FilePath& path) OVERRIDE;
+ virtual void SaveUserWallpaperFromFile(const std::string& username,
+ const FilePath& path,
+ ash::WallpaperLayout layout) OVERRIDE;
virtual void SaveUserImageFromProfileImage(
const std::string& username) OVERRIDE;
virtual void DownloadProfileImage(const std::string& reason) OVERRIDE;
@@ -105,6 +110,10 @@ class UserManagerImpl : public UserManager,
// Returns image filepath for the given user.
FilePath GetImagePathForUser(const std::string& username);
+ // Returns wallpaper/thumbnail filepath for the given user.
+ FilePath GetWallpaperPathForUser(const std::string& username,
+ bool is_thumbnail);
+
private:
friend class UserManagerImplWrapper;
friend class UserManagerTest;
@@ -136,6 +145,9 @@ class UserManagerImpl : public UserManager,
// Notifies on new user session.
void NotifyOnLogin();
+ // Notifies the custom wallpaper thumbnail has ready.
+ void NotifyThumbnailUpdated();
+
// Reads user's oauth token status from local state preferences.
User::OAuthTokenStatus LoadUserOAuthStatus(const std::string& username) const;
@@ -176,6 +188,27 @@ class UserManagerImpl : public UserManager,
int image_index,
const SkBitmap& image);
+ // Saves wallpaper to file, post task to generate thumbnail and updates local
+ // state preferences.
+ void SaveUserWallpaperInternal(const std::string& username,
+ ash::WallpaperLayout layout,
+ User::WallpaperType type,
+ const SkBitmap& image);
+
+ // Asynchronous load custom wallpaper thumbnail.
flackr 2012/05/04 19:06:17 Loads custom wallpaper thumbnail asynchronously.
bshe 2012/05/08 22:22:18 Done.
+ void LoadCustomWallpaperThumbnail(const std::string& email,
+ ash::WallpaperLayout layout,
+ const SkBitmap& wallpaper);
+
+ // Cache the loaded wallpaper to the given user.
flackr 2012/05/04 19:06:17 s/Cache/Caches s/to/for
bshe 2012/05/08 22:22:18 Done.
+ void OnCustomWallpaperThumbnailLoaded(const std::string& email,
+ const SkBitmap& wallpaper);
+
+ // Generate a 128x80 thumbnail and save it local file system.
flackr 2012/05/04 19:06:17 s/Generate/Generates s/save/saves
bshe 2012/05/08 22:22:18 Done.
+ void GenerateUserWallpaperThumbnail(const std::string& username,
+ User::WallpaperType type,
+ const SkBitmap& wallpaper);
+
// Saves image to file with specified path and sends LOGIN_USER_IMAGE_CHANGED
// notification. Runs on FILE thread. Posts task for saving image info to
// Local State on UI thread.
@@ -184,6 +217,14 @@ class UserManagerImpl : public UserManager,
const FilePath& image_path,
int image_index);
+ // Saves wallpaper to file with specified path. Runs on FILE thread. Posts
+ // task for saving wallpaper info to Local State on UI thread.
+ void SaveWallpaperToFile(const std::string& username,
+ const SkBitmap& wallpaper,
+ const FilePath& wallpaper_path,
+ ash::WallpaperLayout layout,
+ User::WallpaperType type);
+
// Stores path to the image and its index in local state. Runs on UI thread.
// If |is_async| is true, it has been posted from the FILE thread after
// saving the image.
@@ -192,6 +233,16 @@ class UserManagerImpl : public UserManager,
int image_index,
bool is_async);
+ // Stores layout and type preference in local state. Runs on UI thread.
+ void SaveWallpaperToLocalState(const std::string& username,
+ const std::string& wallpaper_path,
+ ash::WallpaperLayout layout,
+ User::WallpaperType type);
+
+ // Save |image| to the specified |image_path|. Runs on FILE thread.
flackr 2012/05/04 19:06:17 s/Save/Saves
bshe 2012/05/08 22:22:18 Done.
+ bool SaveBitmapToFile(const SkBitmap& image,
+ const FilePath& image_path);
+
// Initializes |downloaded_profile_picture_| with the picture of the logged-in
// user.
void InitDownloadedProfileImage();
@@ -253,13 +304,8 @@ class UserManagerImpl : public UserManager,
User::WallpaperType current_user_wallpaper_type_;
- //std::string current_user_wallpaper_path_;
-
int current_user_wallpaper_index_;
- // Cache current user selected wallpaper layout in memory.
- //ash::ImageLayout current_user_wallpaper_layout_;
-
// The key store for the current user has been loaded. This flag is needed to
// ensure that the key store will not be loaded twice in the policy recovery
// "safe-mode".

Powered by Google App Engine
This is Rietveld 408576698