| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_model_observer.h" | 12 #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
| 12 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 13 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
| 13 #include "chrome/browser/sync/glue/change_processor.h" | 14 #include "chrome/browser/sync/glue/change_processor.h" |
| 14 #include "chrome/browser/sync/glue/sync_backend_host.h" | 15 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 15 #include "chrome/browser/sync/internal_api/sync_manager.h" | |
| 16 | 16 |
| 17 namespace sync_api { | 17 namespace sync_api { |
| 18 class WriteNode; | 18 class WriteNode; |
| 19 class WriteTransaction; | 19 class WriteTransaction; |
| 20 } // namespace sync_api | 20 } // namespace sync_api |
| 21 | 21 |
| 22 namespace browser_sync { | 22 namespace browser_sync { |
| 23 | 23 |
| 24 // This class is responsible for taking changes from the BookmarkModel | 24 // This class is responsible for taking changes from the BookmarkModel |
| 25 // and applying them to the sync_api 'syncable' model, and vice versa. | 25 // and applying them to the sync_api 'syncable' model, and vice versa. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 const BookmarkNode* node) OVERRIDE; | 52 const BookmarkNode* node) OVERRIDE; |
| 53 virtual void BookmarkNodeFaviconChanged(BookmarkModel* model, | 53 virtual void BookmarkNodeFaviconChanged(BookmarkModel* model, |
| 54 const BookmarkNode* node) OVERRIDE; | 54 const BookmarkNode* node) OVERRIDE; |
| 55 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, | 55 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, |
| 56 const BookmarkNode* node) OVERRIDE; | 56 const BookmarkNode* node) OVERRIDE; |
| 57 | 57 |
| 58 // The change processor implementation, responsible for applying changes from | 58 // The change processor implementation, responsible for applying changes from |
| 59 // the sync model to the bookmarks model. | 59 // the sync model to the bookmarks model. |
| 60 virtual void ApplyChangesFromSyncModel( | 60 virtual void ApplyChangesFromSyncModel( |
| 61 const sync_api::BaseTransaction* trans, | 61 const sync_api::BaseTransaction* trans, |
| 62 const sync_api::SyncManager::ChangeRecord* changes, | 62 const sync_api::ImmutableChangeRecordList& changes) OVERRIDE; |
| 63 int change_count); | |
| 64 | 63 |
| 65 // The following methods are static and hence may be invoked at any time, | 64 // The following methods are static and hence may be invoked at any time, |
| 66 // and do not depend on having a running ChangeProcessor. | 65 // and do not depend on having a running ChangeProcessor. |
| 67 // Creates a bookmark node under the given parent node from the given sync | 66 // Creates a bookmark node under the given parent node from the given sync |
| 68 // node. Returns the newly created node. | 67 // node. Returns the newly created node. |
| 69 static const BookmarkNode* CreateBookmarkNode( | 68 static const BookmarkNode* CreateBookmarkNode( |
| 70 sync_api::BaseNode* sync_node, | 69 sync_api::BaseNode* sync_node, |
| 71 const BookmarkNode* parent, | 70 const BookmarkNode* parent, |
| 72 BookmarkModel* model, | 71 BookmarkModel* model, |
| 73 int index); | 72 int index); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 168 |
| 170 // The two models should be associated according to this ModelAssociator. | 169 // The two models should be associated according to this ModelAssociator. |
| 171 BookmarkModelAssociator* model_associator_; | 170 BookmarkModelAssociator* model_associator_; |
| 172 | 171 |
| 173 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); | 172 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); |
| 174 }; | 173 }; |
| 175 | 174 |
| 176 } // namespace browser_sync | 175 } // namespace browser_sync |
| 177 | 176 |
| 178 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 177 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
| OLD | NEW |