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

Unified Diff: chrome/browser/ui/webui/ntp/bookmarks_handler.h

Issue 7713026: [ntp4] Observe and process bookmark change notifications from the bookmarks data model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: code review changes; rebase Created 9 years, 4 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/ui/webui/ntp/bookmarks_handler.h
===================================================================
--- chrome/browser/ui/webui/ntp/bookmarks_handler.h (revision 98269)
+++ chrome/browser/ui/webui/ntp/bookmarks_handler.h (working copy)
@@ -6,27 +6,46 @@
#define CHROME_BROWSER_UI_WEBUI_NTP_BOOKMARKS_HANDLER_H_
#pragma once
+#include "chrome/browser/bookmarks/bookmark_model_observer.h"
#include "content/browser/webui/web_ui.h"
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
class PrefService;
class Profile;
// The handler for Javascript messages related to the "bookmarks" view.
class BookmarksHandler : public WebUIMessageHandler,
- public NotificationObserver {
+ public BookmarkModelObserver {
public:
explicit BookmarksHandler();
virtual ~BookmarksHandler();
// WebUIMessageHandler implementation.
+ virtual WebUIMessageHandler* Attach(WebUI* web_ui) OVERRIDE;
virtual void RegisterMessages() OVERRIDE;
- // NotificationObserver
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
+ // BookmarkModelObserver implementation.
+ virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE;
+ virtual void BookmarkModelBeingDeleted(BookmarkModel* model) OVERRIDE;
+ virtual void BookmarkNodeMoved(BookmarkModel* model,
+ const BookmarkNode* old_parent,
+ int old_index,
+ const BookmarkNode* new_parent,
+ int new_index) OVERRIDE;
+ virtual void BookmarkNodeAdded(BookmarkModel* model,
+ const BookmarkNode* parent,
+ int index) OVERRIDE;
+ virtual void BookmarkNodeRemoved(BookmarkModel* model,
+ const BookmarkNode* parent,
+ int old_index,
+ const BookmarkNode* node) OVERRIDE;
+ virtual void BookmarkNodeChanged(BookmarkModel* model,
+ const BookmarkNode* node) OVERRIDE;
+ virtual void BookmarkNodeFaviconChanged(BookmarkModel* model,
+ const BookmarkNode* node) OVERRIDE;
+ virtual void BookmarkNodeChildrenReordered(BookmarkModel* model,
+ const BookmarkNode* node) OVERRIDE;
+ virtual void BookmarkImportBeginning(BookmarkModel* model) OVERRIDE;
+ virtual void BookmarkImportEnding(BookmarkModel* model) OVERRIDE;
// Callback for the "getBookmarksData" message.
void HandleGetBookmarksData(const base::ListValue* args);
@@ -35,7 +54,8 @@
static void RegisterUserPrefs(PrefService* prefs);
private:
- NotificationRegistrar registrar_;
+ BookmarkModel* model_; // weak
+ bool getBookmarksDataIsPending_;
DISALLOW_COPY_AND_ASSIGN(BookmarksHandler);
};

Powered by Google App Engine
This is Rietveld 408576698