Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / bookmark_change_processor.h
index f0474b0..cd86131 100644 (file)
@@ -8,12 +8,15 @@
 #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;
 }
@@ -32,7 +35,8 @@ namespace browser_sync {
 class BookmarkChangeProcessor : public BookmarkModelObserver,
                                 public ChangeProcessor {
  public:
-  BookmarkChangeProcessor(BookmarkModelAssociator* model_associator,
+  BookmarkChangeProcessor(Profile* profile,
+                          BookmarkModelAssociator* model_associator,
                           DataTypeErrorHandler* error_handler);
   virtual ~BookmarkChangeProcessor();
 
@@ -52,8 +56,11 @@ class BookmarkChangeProcessor : public BookmarkModelObserver,
   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,
@@ -134,7 +141,7 @@ class BookmarkChangeProcessor : public BookmarkModelObserver,
       const std::vector<const BookmarkNode*>& nodes);
 
  protected:
-  virtual void StartImpl(Profile* profile) OVERRIDE;
+  virtual void StartImpl() OVERRIDE;
 
  private:
   enum MoveOrCreate {
@@ -142,10 +149,9 @@ class BookmarkChangeProcessor : public BookmarkModelObserver,
     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,