| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class WriteNode; | 25 class WriteNode; |
| 26 class WriteTransaction; | 26 class WriteTransaction; |
| 27 } // namespace syncer | 27 } // namespace syncer |
| 28 | 28 |
| 29 namespace browser_sync { | 29 namespace browser_sync { |
| 30 | 30 |
| 31 // This class is responsible for taking changes from the BookmarkModel | 31 // This class is responsible for taking changes from the BookmarkModel |
| 32 // and applying them to the sync API 'syncable' model, and vice versa. | 32 // and applying them to the sync API 'syncable' model, and vice versa. |
| 33 // All operations and use of this class are from the UI thread. | 33 // All operations and use of this class are from the UI thread. |
| 34 // This is currently bookmarks specific. | 34 // This is currently bookmarks specific. |
| 35 class BookmarkChangeProcessor : public BookmarkModelObserver, | 35 class BookmarkChangeProcessor : public bookmarks::BookmarkModelObserver, |
| 36 public sync_driver::ChangeProcessor { | 36 public sync_driver::ChangeProcessor { |
| 37 public: | 37 public: |
| 38 BookmarkChangeProcessor(Profile* profile, | 38 BookmarkChangeProcessor(Profile* profile, |
| 39 BookmarkModelAssociator* model_associator, | 39 BookmarkModelAssociator* model_associator, |
| 40 sync_driver::DataTypeErrorHandler* error_handler); | 40 sync_driver::DataTypeErrorHandler* error_handler); |
| 41 ~BookmarkChangeProcessor() override; | 41 ~BookmarkChangeProcessor() override; |
| 42 | 42 |
| 43 // BookmarkModelObserver implementation. | 43 // bookmarks::BookmarkModelObserver: |
| 44 // BookmarkModel -> sync API model change application. | 44 // BookmarkModel -> sync API model change application. |
| 45 void BookmarkModelLoaded(BookmarkModel* model, bool ids_reassigned) override; | 45 void BookmarkModelLoaded(BookmarkModel* model, bool ids_reassigned) override; |
| 46 void BookmarkModelBeingDeleted(BookmarkModel* model) override; | 46 void BookmarkModelBeingDeleted(BookmarkModel* model) override; |
| 47 void BookmarkNodeMoved(BookmarkModel* model, | 47 void BookmarkNodeMoved(BookmarkModel* model, |
| 48 const BookmarkNode* old_parent, | 48 const BookmarkNode* old_parent, |
| 49 int old_index, | 49 int old_index, |
| 50 const BookmarkNode* new_parent, | 50 const BookmarkNode* new_parent, |
| 51 int new_index) override; | 51 int new_index) override; |
| 52 void BookmarkNodeAdded(BookmarkModel* model, | 52 void BookmarkNodeAdded(BookmarkModel* model, |
| 53 const BookmarkNode* parent, | 53 const BookmarkNode* parent, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 // The two models should be associated according to this ModelAssociator. | 216 // The two models should be associated according to this ModelAssociator. |
| 217 BookmarkModelAssociator* model_associator_; | 217 BookmarkModelAssociator* model_associator_; |
| 218 | 218 |
| 219 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); | 219 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 } // namespace browser_sync | 222 } // namespace browser_sync |
| 223 | 223 |
| 224 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 224 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
| OLD | NEW |