#ifndef CHROME_BROWSER_UNDO_BOOKMARK_UNDO_SERVICE_H_
#define CHROME_BROWSER_UNDO_BOOKMARK_UNDO_SERVICE_H_
#include <map>
#include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/undo/bookmark_renumber_observer.h"
#include "chrome/browser/undo/undo_manager.h"
#include "components/keyed_service/core/keyed_service.h"
class Profile;
namespace {
class BookmarkUndoOperation;
}
class BookmarkUndoService : public BaseBookmarkModelObserver,
public KeyedService,
public BookmarkRenumberObserver {
public:
explicit BookmarkUndoService(Profile* profile);
virtual ~BookmarkUndoService();
UndoManager* undo_manager() { return &undo_manager_; }
private:
virtual void BookmarkModelChanged() OVERRIDE {}
virtual void BookmarkModelLoaded(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 OnWillRemoveBookmarks(BookmarkModel* model,
const BookmarkNode* parent,
int old_index,
const BookmarkNode* node) OVERRIDE;
virtual void OnWillRemoveAllBookmarks(BookmarkModel* model) OVERRIDE;
virtual void OnWillChangeBookmarkNode(BookmarkModel* model,
const BookmarkNode* node) OVERRIDE;
virtual void OnWillReorderBookmarkNode(BookmarkModel* model,
const BookmarkNode* node) OVERRIDE;
virtual void GroupedBookmarkChangesBeginning(BookmarkModel* model) OVERRIDE;
virtual void GroupedBookmarkChangesEnded(BookmarkModel* model) OVERRIDE;
virtual void OnBookmarkRenumbered(int64 old_id, int64 new_id) OVERRIDE;
Profile* profile_;
UndoManager undo_manager_;
DISALLOW_COPY_AND_ASSIGN(BookmarkUndoService);
};
#endif