| Index: components/bookmarks/browser/bookmark_model.h
|
| diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
|
| index 27837703d0adc6719ef330fb483cd6afe1d1bcb7..7e17c1857479531a1f001c37e71698b950c1f432 100644
|
| --- a/components/bookmarks/browser/bookmark_model.h
|
| +++ b/components/bookmarks/browser/bookmark_model.h
|
| @@ -20,6 +20,7 @@
|
| #include "base/synchronization/waitable_event.h"
|
| #include "components/bookmarks/browser/bookmark_client.h"
|
| #include "components/bookmarks/browser/bookmark_node.h"
|
| +#include "components/bookmarks/browser/bookmark_undo_provider.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
| #include "ui/gfx/image/image.h"
|
| #include "url/gurl.h"
|
| @@ -47,6 +48,7 @@ class BookmarkIndex;
|
| class BookmarkLoadDetails;
|
| class BookmarkModelObserver;
|
| class BookmarkStorage;
|
| +class BookmarkUndoDelegate;
|
| class ScopedGroupBookmarkActions;
|
| class TestBookmarkClient;
|
| struct BookmarkMatch;
|
| @@ -61,7 +63,8 @@ struct BookmarkMatch;
|
| //
|
| // You should NOT directly create a BookmarkModel, instead go through the
|
| // BookmarkModelFactory.
|
| -class BookmarkModel : public KeyedService {
|
| +class BookmarkModel : public BookmarkUndoProvider,
|
| + public KeyedService {
|
| public:
|
| struct URLAndTitle {
|
| GURL url;
|
| @@ -308,6 +311,8 @@ class BookmarkModel : public KeyedService {
|
| // Returns the client used by this BookmarkModel.
|
| BookmarkClient* client() const { return client_; }
|
|
|
| + void SetUndoDelegate(BookmarkUndoDelegate* undo_delegate);
|
| +
|
| private:
|
| friend class BookmarkCodecTest;
|
| friend class BookmarkModelFaviconTest;
|
| @@ -323,6 +328,14 @@ class BookmarkModel : public KeyedService {
|
| }
|
| };
|
|
|
| + // BookmarkUndoProvider:
|
| + void RestoreRemovedNode(const BookmarkNode* parent,
|
| + int index,
|
| + scoped_ptr<BookmarkNode> node) override;
|
| +
|
| + // Notifies the observers for adding every descedent of |node|.
|
| + void NotifyNodeAddedForAllDescendents(const BookmarkNode* node);
|
| +
|
| // Implementation of IsBookmarked. Before calling this the caller must obtain
|
| // a lock on |url_lock_|.
|
| bool IsBookmarkedNoLock(const GURL& url);
|
| @@ -405,6 +418,8 @@ class BookmarkModel : public KeyedService {
|
| scoped_ptr<BookmarkLoadDetails> CreateLoadDetails(
|
| const std::string& accept_languages);
|
|
|
| + BookmarkUndoDelegate* undo_delegate() const;
|
| +
|
| BookmarkClient* const client_;
|
|
|
| // Whether the initial set of data has been loaded.
|
| @@ -449,6 +464,9 @@ class BookmarkModel : public KeyedService {
|
|
|
| std::set<std::string> non_cloned_keys_;
|
|
|
| + BookmarkUndoDelegate* undo_delegate_;
|
| + scoped_ptr<BookmarkUndoDelegate> empty_undo_delegate_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
|
| };
|
|
|
|
|