#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXPANDED_STATE_TRACKER_H_
#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXPANDED_STATE_TRACKER_H_
#include <set>
#include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
class BookmarkModel;
class BookmarkNode;
class PrefService;
class BookmarkExpandedStateTracker : public BaseBookmarkModelObserver {
public:
typedef std::set<const BookmarkNode*> Nodes;
BookmarkExpandedStateTracker(BookmarkModel* bookmark_model,
PrefService* pref_service);
virtual ~BookmarkExpandedStateTracker();
void SetExpandedNodes(const Nodes& nodes);
Nodes GetExpandedNodes();
private:
virtual void BookmarkModelLoaded(BookmarkModel* model,
bool ids_reassigned) OVERRIDE;
virtual void BookmarkModelChanged() OVERRIDE;
virtual void BookmarkModelBeingDeleted(BookmarkModel* model) OVERRIDE;
virtual void BookmarkNodeRemoved(BookmarkModel* model,
const BookmarkNode* parent,
int old_index,
const BookmarkNode* node) OVERRIDE;
virtual void BookmarkAllNodesRemoved(BookmarkModel* model) OVERRIDE;
void UpdatePrefs(const Nodes& nodes);
BookmarkModel* bookmark_model_;
PrefService* pref_service_;
DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTracker);
};
#endif