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

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

Issue 1010443003: Make the lifetime of wallpaper manager more clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the failed unittests. Created 5 years, 9 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/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 536d752dcfb088f21aec427677d048e5cf58592c..1faa368134033f4ee8b6ebb369ff7b204d0e9ffe 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h
@@ -37,19 +37,22 @@ class WallpaperManager :
public:
class PendingWallpaper;
- WallpaperManager();
~WallpaperManager() override;
- // Get pointer to singleton WallpaperManager instance, create it if necessary.
+ // Creates an instance of Wallpaper Manager. If there is no instance, create
+ // one. Otherwise, returns the existing instance.
+ static void Initialize();
+
+ // Gets pointer to singleton WallpaperManager instance.
static WallpaperManager* Get();
+ // Deletes the existing instance of WallpaperManager. Allows the
+ // WallpaperManager to remove any observers it has registered.
+ static void Shutdown();
+
// Returns the appropriate wallpaper resolution for all root windows.
WallpaperResolution GetAppropriateResolution() override;
- // Indicates imminent shutdown, allowing the WallpaperManager to remove any
- // observers it has registered.
- void Shutdown() override;
-
// Adds PowerManagerClient, TimeZoneSettings and CrosSettings observers.
void AddObservers() override;
@@ -127,6 +130,8 @@ class WallpaperManager :
friend class WallpaperManagerBrowserTestDefaultWallpaper;
friend class WallpaperManagerPolicyTest;
+ WallpaperManager();
+
// Returns modifiable PendingWallpaper.
// Returns pending_inactive_ or creates new PendingWallpaper if necessary.
PendingWallpaper* GetPendingWallpaper(const std::string& user_id,

Powered by Google App Engine
This is Rietveld 408576698