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

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

Issue 24625003: Delay wallpaper load by 2 * average wallpaper load time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 7 years, 1 month 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/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/wallpaper_manager.h
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.h b/chrome/browser/chromeos/login/wallpaper_manager.h
index 3a6a0ffce59eec156a8f06b148e0f9ed6b2f5c08..ac8379cebdb3d9932dc1192cc17e095add62c614 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager.h
+++ b/chrome/browser/chromeos/login/wallpaper_manager.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/time/time.h"
#include "chrome/browser/chromeos/login/user.h"
@@ -80,6 +81,12 @@ class WallpaperManager: public content::NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(TestApi);
};
+ class Observer {
+ public:
+ virtual ~Observer() {}
+ virtual void OnWallpaperAnimationFinished(const std::string& email) = 0;
+ };
+
static WallpaperManager* Get();
WallpaperManager();
@@ -188,6 +195,12 @@ class WallpaperManager: public content::NotificationObserver {
// current display's resolution.
void UpdateWallpaper();
+ // Adds given observer to the list.
+ void AddObserver(Observer* observer);
+
+ // Removes given observer from the list.
+ void RemoveObserver(Observer* observer);
+
private:
friend class TestApi;
friend class WallpaperManagerBrowserTest;
@@ -306,6 +319,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_;
@@ -342,6 +358,8 @@ class WallpaperManager: public content::NotificationObserver {
content::NotificationRegistrar registrar_;
+ ObserverList<Observer> observers_;
+
DISALLOW_COPY_AND_ASSIGN(WallpaperManager);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/wallpaper_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698