Index: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h |
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h |
index a06983d16bc3f485cad11df0e9ca46ee8b5c5229..3b9410692dfe868b57f57ad43d38610050d92c08 100644 |
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h |
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h |
@@ -223,6 +223,22 @@ class WallpaperManager: public content::NotificationObserver { |
// Returns the appropriate wallpaper resolution for all root windows. |
static WallpaperResolution GetAppropriateResolution(); |
+ // Returns custom wallpaper path. Append |sub_dir|, |user_id_hash| and |file| |
+ // to custom wallpaper directory. |
+ static base::FilePath GetCustomWallpaperPath(const char* sub_dir, |
+ const std::string& user_id_hash, |
+ const std::string& file); |
+ |
+ // Record data for User Metrics Analysis. |
+ static void RecordUma(User::WallpaperType type, int index); |
+ |
+ // Saves original custom wallpaper to |path| (absolute path) on filesystem |
+ // and starts resizing operation of the custom wallpaper if necessary. |
+ static void SaveCustomWallpaper(const std::string& user_id_hash, |
+ const base::FilePath& path, |
+ ash::WallpaperLayout layout, |
+ scoped_ptr<gfx::ImageSkia> image); |
+ |
void SetCommandLineForTesting(base::CommandLine* command_line); |
// Indicates imminent shutdown, allowing the WallpaperManager to remove any |
@@ -236,12 +252,6 @@ class WallpaperManager: public content::NotificationObserver { |
// wallpaper of logged in user. |
void EnsureLoggedInUserWallpaperLoaded(); |
- // Returns custom wallpaper path. Append |sub_dir|, |user_id_hash| and |file| |
- // to custom wallpaper directory. |
- base::FilePath GetCustomWallpaperPath(const char* sub_dir, |
- const std::string& user_id_hash, |
- const std::string& file) const; |
- |
// Gets wallpaper information of logged in user. |
bool GetLoggedInUserWallpaperInfo(WallpaperInfo* info); |
@@ -343,6 +353,7 @@ class WallpaperManager: public content::NotificationObserver { |
private: |
friend class TestApi; |
+ friend class PendingWallpaper; |
friend class WallpaperManagerBrowserTest; |
friend class WallpaperManagerBrowserTestDefaultWallpaper; |
friend class WallpaperManagerPolicyTest; |
@@ -406,8 +417,10 @@ class WallpaperManager: public content::NotificationObserver { |
// Moves custom wallpapers from |user_id| directory to |user_id_hash| |
// directory. |
- void MoveCustomWallpapersOnWorker(const std::string& user_id, |
- const std::string& user_id_hash); |
+ static void MoveCustomWallpapersOnWorker( |
+ const std::string& user_id, |
+ const std::string& user_id_hash, |
+ base::WeakPtr<WallpaperManager> weak_ptr); |
// Called when the original custom wallpaper is moved to the new place. |
// Updates the corresponding user wallpaper info. |
@@ -423,11 +436,13 @@ class WallpaperManager: public content::NotificationObserver { |
// Gets |user_id|'s custom wallpaper at |wallpaper_path|. Falls back on |
// original custom wallpaper. When |update_wallpaper| is true, sets wallpaper |
// to the loaded wallpaper. Must run on wallpaper sequenced worker thread. |
- void GetCustomWallpaperInternal(const std::string& user_id, |
- const WallpaperInfo& info, |
- const base::FilePath& wallpaper_path, |
- bool update_wallpaper, |
- MovableOnDestroyCallbackHolder on_finish); |
+ static void GetCustomWallpaperInternal( |
+ const std::string& user_id, |
+ const WallpaperInfo& info, |
+ const base::FilePath& wallpaper_path, |
+ bool update_wallpaper, |
+ MovableOnDestroyCallbackHolder on_finish, |
+ base::WeakPtr<WallpaperManager> weak_ptr); |
// Gets wallpaper information of |user_id| from Local State or memory. Returns |
// false if wallpaper information is not found. |
@@ -443,16 +458,6 @@ class WallpaperManager: public content::NotificationObserver { |
MovableOnDestroyCallbackHolder on_finish, |
const UserImage& user_image); |
- // Record data for User Metrics Analysis. |
- void RecordUma(User::WallpaperType type, int index) const; |
- |
- // Saves original custom wallpaper to |path| (absolute path) on filesystem |
- // and starts resizing operation of the custom wallpaper if necessary. |
- void SaveCustomWallpaper(const std::string& user_id_hash, |
- const base::FilePath& path, |
- ash::WallpaperLayout layout, |
- scoped_ptr<gfx::ImageSkia> image) const; |
- |
// Creates new PendingWallpaper request (or updates currently pending). |
void ScheduleSetUserWallpaper(const std::string& user_id, bool delayed); |
@@ -503,7 +508,7 @@ class WallpaperManager: public content::NotificationObserver { |
const UserImage& user_image); |
// Resize and save customized default wallpaper. |
- void ResizeCustomizedDefaultWallpaper( |
+ static void ResizeCustomizedDefaultWallpaper( |
scoped_ptr<gfx::ImageSkia> image, |
const UserImage::RawImage& raw_image, |
const CustomizedWallpaperRescaledFiles* rescaled_files, |