#include <vector>
#include "base/compiler_specific.h"
-#include "chrome/browser/bookmarks/bookmark_model_observer.h"
#include "chrome/browser/sync/glue/bookmark_model_associator.h"
-#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
+#include "components/bookmarks/core/browser/bookmark_model_observer.h"
+#include "components/bookmarks/core/browser/bookmark_node.h"
+#include "components/sync_driver/change_processor.h"
#include "components/sync_driver/data_type_error_handler.h"
+class Profile;
+
namespace base {
class RefCountedMemory;
}
class BookmarkChangeProcessor : public BookmarkModelObserver,
public ChangeProcessor {
public:
- BookmarkChangeProcessor(BookmarkModelAssociator* model_associator,
+ BookmarkChangeProcessor(Profile* profile,
+ BookmarkModelAssociator* model_associator,
DataTypeErrorHandler* error_handler);
virtual ~BookmarkChangeProcessor();
virtual void BookmarkNodeRemoved(BookmarkModel* model,
const BookmarkNode* parent,
int index,
- const BookmarkNode* node) OVERRIDE;
- virtual void BookmarkAllNodesRemoved(BookmarkModel* model) OVERRIDE;
+ const BookmarkNode* node,
+ const std::set<GURL>& removed_urls) OVERRIDE;
+ virtual void BookmarkAllNodesRemoved(
+ BookmarkModel* model,
+ const std::set<GURL>& removed_urls) OVERRIDE;
virtual void BookmarkNodeChanged(BookmarkModel* model,
const BookmarkNode* node) OVERRIDE;
virtual void BookmarkMetaInfoChanged(BookmarkModel* model,
const std::vector<const BookmarkNode*>& nodes);
protected:
- virtual void StartImpl(Profile* profile) OVERRIDE;
+ virtual void StartImpl() OVERRIDE;
private:
enum MoveOrCreate {
CREATE,
};
- // Sets the meta info of the given bookmark node from the given sync node.
- static void SetBookmarkMetaInfo(const syncer::BaseNode* sync_node,
- const BookmarkNode* bookmark_node,
- BookmarkModel* bookmark_model);
+ // Retrieves the meta info from the given sync node.
+ static scoped_ptr<BookmarkNode::MetaInfoMap> GetBookmarkMetaInfo(
+ const syncer::BaseNode* sync_node);
// Sets the meta info of the given sync node from the given bookmark node.
static void SetSyncNodeMetaInfo(const BookmarkNode* node,