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

Unified Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h

Issue 322233002: Remove more unretained (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698