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

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

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove NotificationObserver from InMemoryURLIndex Created 6 years 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_impl.h
diff --git a/chrome/browser/history/top_sites_impl.h b/chrome/browser/history/top_sites_impl.h
index cea6f84d8ab24aff6df8483b7a7a4ccfcdb4b0c0..df576f807fe2da802057967b56433f27af40ce7f 100644
--- a/chrome/browser/history/top_sites_impl.h
+++ b/chrome/browser/history/top_sites_impl.h
@@ -15,6 +15,7 @@
#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
+#include "base/scoped_observer.h"
#include "base/synchronization/lock.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
@@ -22,6 +23,7 @@
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/history/top_sites_backend.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/page_usage_data.h"
#include "components/history/core/common/thumbnail_score.h"
@@ -46,7 +48,7 @@ class TopSitesImplTest;
// thread. All other methods must be invoked on the UI thread. All mutations
// to internal state happen on the UI thread and are scheduled to update the
// db using TopSitesBackend.
-class TopSitesImpl : public TopSites {
+class TopSitesImpl : public TopSites, public HistoryServiceObserver {
public:
explicit TopSitesImpl(Profile* profile);
@@ -210,6 +212,12 @@ class TopSitesImpl : public TopSites {
// Called when history service returns a list of top URLs.
void OnTopSitesAvailableFromHistory(const MostVisitedURLList* data);
+ // history::HistoryServiceObserver:
+ void OnURLsDeleted(
+ HistoryService* history_service,
+ const history::URLsDeletedDetails& deleted_details) override;
+ void HistoryServiceBeingDeleted(HistoryService* history_service) override;
+
scoped_refptr<TopSitesBackend> backend_;
// The top sites data.
@@ -257,6 +265,9 @@ class TopSitesImpl : public TopSites {
// Are we loaded?
bool loaded_;
+ ScopedObserver<HistoryService, HistoryServiceObserver>
+ history_service_observer_;
+
DISALLOW_COPY_AND_ASSIGN(TopSitesImpl);
};

Powered by Google App Engine
This is Rietveld 408576698