Chromium Code Reviews| Index: chrome/browser/sync/glue/bookmark_data_type_controller.h |
| diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.h b/chrome/browser/sync/glue/bookmark_data_type_controller.h |
| index c16c409410f0286f9569548442f65e5739fe9bfb..ea22f837a96659064bdb98ee7e50b640c5b1cacd 100644 |
| --- a/chrome/browser/sync/glue/bookmark_data_type_controller.h |
| +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.h |
| @@ -8,17 +8,17 @@ |
| #include <string> |
| #include "base/compiler_specific.h" |
| +#include "base/scoped_observer.h" |
| #include "chrome/browser/sync/glue/frontend_data_type_controller.h" |
| #include "components/bookmarks/browser/base_bookmark_model_observer.h" |
| -#include "content/public/browser/notification_observer.h" |
| -#include "content/public/browser/notification_registrar.h" |
| +#include "components/history/core/browser/history_service_observer.h" |
| namespace browser_sync { |
| // A class that manages the startup and shutdown of bookmark sync. |
| class BookmarkDataTypeController : public FrontendDataTypeController, |
| - public content::NotificationObserver, |
| - public BaseBookmarkModelObserver { |
| + public BaseBookmarkModelObserver, |
| + public history::HistoryServiceObserver { |
| public: |
| BookmarkDataTypeController(ProfileSyncComponentsFactory* profile_sync_factory, |
| Profile* profile, |
| @@ -27,10 +27,9 @@ class BookmarkDataTypeController : public FrontendDataTypeController, |
| // FrontendDataTypeController interface. |
| syncer::ModelType type() const override; |
| - // content::NotificationObserver interface. |
| - void Observe(int type, |
| - const content::NotificationSource& source, |
| - const content::NotificationDetails& details) override; |
| + // history::HistoryServiceObserver: |
| + void OnHistoryServiceLoaded(HistoryService* service) override; |
|
brettw
2014/11/14 21:13:07
private.
nshaik
2014/11/15 07:04:15
Done.
|
| + void HistoryServiceBeingDeleted(HistoryService* history_service) override; |
| private: |
| ~BookmarkDataTypeController() override; |
| @@ -49,12 +48,12 @@ class BookmarkDataTypeController : public FrontendDataTypeController, |
| // service have finished loading. |
| bool DependentsLoaded(); |
| - content::NotificationRegistrar registrar_; |
| - |
| BookmarkModel* bookmark_model_; |
| - // Have we installed ourselves as a BookmarkModel observer? |
| - bool installed_bookmark_observer_; |
| + ScopedObserver<HistoryService, HistoryServiceObserver> |
| + history_service_observer_; |
| + ScopedObserver<BookmarkModel, BaseBookmarkModelObserver> |
| + bookmark_model_observer_; |
| DISALLOW_COPY_AND_ASSIGN(BookmarkDataTypeController); |
| }; |