summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/base_bookmark_model_observer.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 19:10:22 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 19:10:22 +0000
commit7aa4c00e8f6464212974198b3a8a1bd4427fe53d (patch)
tree1f7b0b358e9e9e225df536ad268536b9e402561d /chrome/browser/bookmarks/base_bookmark_model_observer.h
parentb3fb80902af2bbb14a755c9a77adb6c21d4987a3 (diff)
downloadchromium_src-7aa4c00e8f6464212974198b3a8a1bd4427fe53d.zip
chromium_src-7aa4c00e8f6464212974198b3a8a1bd4427fe53d.tar.gz
chromium_src-7aa4c00e8f6464212974198b3a8a1bd4427fe53d.tar.bz2
Refactors code for showing bookmarks menus into a standalone class
that isn't tied to the bookmark bar. Removes some dead code from the bookmark bar, and fixes a UMR in chrome_menu that I found when running under purify. There isn't any behavior change in this patch. BUG=none TEST=this is a large refactoring of how bookmark menus are shown. Please thoroughly test menus on the bookmark bar to make sure I didn't screw anything up. Review URL: http://codereview.chromium.org/42128 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/base_bookmark_model_observer.h')
-rw-r--r--chrome/browser/bookmarks/base_bookmark_model_observer.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/chrome/browser/bookmarks/base_bookmark_model_observer.h b/chrome/browser/bookmarks/base_bookmark_model_observer.h
new file mode 100644
index 0000000..34d755f
--- /dev/null
+++ b/chrome/browser/bookmarks/base_bookmark_model_observer.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_BOOKMARKS_BASE_BOOKMARK_MODEL_OBSERVER_H_
+#define CHROME_BROWSER_BOOKMARKS_BASE_BOOKMARK_MODEL_OBSERVER_H_
+
+#include "chrome/browser/bookmarks/bookmark_model.h"
+
+// Base class for a BookmarkModelObserver implementation. All mutations of the
+// model funnel into the method BookmarkModelChanged.
+class BaseBookmarkModelObserver : public BookmarkModelObserver {
+ public:
+ BaseBookmarkModelObserver() {}
+ virtual ~BaseBookmarkModelObserver() {}
+
+ virtual void BookmarkModelChanged() = 0;
+
+ virtual void Loaded(BookmarkModel* model) {}
+
+ virtual void BookmarkModelBeingDeleted(BookmarkModel* model) {
+ BookmarkModelChanged();
+ }
+ virtual void BookmarkNodeMoved(BookmarkModel* model,
+ BookmarkNode* old_parent,
+ int old_index,
+ BookmarkNode* new_parent,
+ int new_index) {
+ BookmarkModelChanged();
+ }
+ virtual void BookmarkNodeAdded(BookmarkModel* model,
+ BookmarkNode* parent,
+ int index) {
+ BookmarkModelChanged();
+ }
+ virtual void BookmarkNodeRemoved(BookmarkModel* model,
+ BookmarkNode* parent,
+ int index) {
+ BookmarkModelChanged();
+ }
+ virtual void BookmarkNodeChanged(BookmarkModel* model,
+ BookmarkNode* node) {
+ BookmarkModelChanged();
+ }
+ virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model,
+ BookmarkNode* node) {
+ }
+ virtual void BookmarkNodeChildrenReordered(BookmarkModel* model,
+ BookmarkNode* node) {
+ BookmarkModelChanged();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BaseBookmarkModelObserver);
+};
+
+#endif // CHROME_BROWSER_BOOKMARKS_BASE_BOOKMARK_MODEL_OBSERVER_H_