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

Unified Diff: chrome/browser/history/top_sites.h

Issue 441623002: Eliminate sending NOTIFICATION_TOP_SITES_* from TopSites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving the WaitTopSitesLoadedObserver to testing_profile Created 6 years, 3 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/history/top_sites.h
diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h
index 47ed7de8cfe4b78d75d2d05e6d687adafbeb744e..d8f9c298875c6d44a84b0b044721e91543296946 100644
--- a/chrome/browser/history/top_sites.h
+++ b/chrome/browser/history/top_sites.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_types.h"
+#include "components/history/core/browser/top_sites_observer.h"
#include "components/history/core/common/thumbnail_score.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/image/image.h"
@@ -38,7 +39,7 @@ class TopSites
: public base::RefCountedThreadSafe<TopSites>,
public content::NotificationObserver {
public:
- TopSites() {}
+ TopSites();
// Initializes TopSites.
static TopSites* Create(Profile* profile, const base::FilePath& db_name);
@@ -167,10 +168,20 @@ class TopSites
// The best color to highlight the page (should roughly match favicon).
SkColor color;
};
+
+ // Add Observer to the list.
+ void AddObserver(TopSitesObserver* observer);
+
+ // Remove Observer from the list.
+ void RemoveObserver(TopSitesObserver* observer);
+
protected:
- virtual ~TopSites() {}
+ void NotifyTopSitesLoaded();
+ void NotifyTopSitesChanged();
+ virtual ~TopSites();
private:
+ ObserverList<TopSitesObserver> observer_list_;
friend class base::RefCountedThreadSafe<TopSites>;
};

Powered by Google App Engine
This is Rietveld 408576698