Index: chrome/browser/chromeos/login/wallpaper_manager.h |
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.h b/chrome/browser/chromeos/login/wallpaper_manager.h |
index cbf7af5add84640df06e6fce247545246c42ce98..8560d274b9dab0e690f9705e82f8c6302f79e712 100644 |
--- a/chrome/browser/chromeos/login/wallpaper_manager.h |
+++ b/chrome/browser/chromeos/login/wallpaper_manager.h |
@@ -64,7 +64,7 @@ extern const char kThumbnailWallpaperSubDir[]; |
// This class maintains wallpapers for users who have logged into this Chrome |
// OS device. |
-class WallpaperManager: public content::NotificationObserver { |
+class WallpaperManager : public content::NotificationObserver { |
public: |
// For testing. |
class TestApi { |
@@ -80,6 +80,14 @@ class WallpaperManager: public content::NotificationObserver { |
DISALLOW_COPY_AND_ASSIGN(TestApi); |
}; |
+ class Observer : public base::RefCounted<Observer> { |
+ public: |
+ virtual ~Observer() {}; |
+ virtual void OnWallpaperAnimationFinished(const std::string& email) = 0; |
+ }; |
+ |
+ typedef std::list<base::WeakPtr<Observer> > ObserverList; |
dzhioev (left Google)
2013/10/17 12:47:49
Use ObserverList from base/observer_list.h
|
+ |
static WallpaperManager* Get(); |
WallpaperManager(); |
@@ -187,6 +195,9 @@ class WallpaperManager: public content::NotificationObserver { |
// current display's resolution. |
void UpdateWallpaper(); |
+ // Adds given observer to the list. |
+ void AddObserver(base::WeakPtr<Observer> observer); |
+ |
private: |
friend class TestApi; |
friend class WallpaperManagerBrowserTest; |
@@ -287,6 +298,9 @@ class WallpaperManager: public content::NotificationObserver { |
bool update_wallpaper, |
const base::FilePath& wallpaper_path); |
+ // Notify all registed observers. |
+ void NotifyAnimationFinished(); |
+ |
// The number of loaded wallpapers. |
int loaded_wallpapers_; |
@@ -323,6 +337,8 @@ class WallpaperManager: public content::NotificationObserver { |
content::NotificationRegistrar registrar_; |
+ ObserverList observers_; |
+ |
DISALLOW_COPY_AND_ASSIGN(WallpaperManager); |
}; |