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

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: Rob and James reivew 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
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 b5d2d5333f02d62c43d858d03a17744e0efb8638..b9c5b64f2bedeb2aeafa0da0ddd9a982084f1e7e 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.h
+++ b/chrome/browser/chromeos/login/user_manager_impl.h
@@ -74,8 +74,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;
@@ -107,6 +112,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;
@@ -138,6 +147,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;
@@ -178,6 +190,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);
+
+ // Loads custom wallpaper thumbnail asynchronously.
+ void LoadCustomWallpaperThumbnail(const std::string& email,
+ ash::WallpaperLayout layout,
+ const SkBitmap& wallpaper);
+
+ // Caches the loaded wallpaper for the given user.
+ void OnCustomWallpaperThumbnailLoaded(const std::string& email,
+ const SkBitmap& wallpaper);
+
+ // Generates a 128x80 thumbnail and saves it to local file system.
+ 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.
@@ -186,6 +219,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.
@@ -194,6 +235,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);
+
+ // Saves |image| to the specified |image_path|. Runs on FILE thread.
+ bool SaveBitmapToFile(const SkBitmap& image,
+ const FilePath& image_path);
+
// Initializes |downloaded_profile_picture_| with the picture of the logged-in
// user.
void InitDownloadedProfileImage();

Powered by Google App Engine
This is Rietveld 408576698