summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/base_bookmark_model_observer.h
blob: 34d755fd740012ee3156fee177b8a5a545eb38ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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_