| 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_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 class BookmarkModelAssociator | 33 class BookmarkModelAssociator |
| 34 : public PerDataTypeAssociatorInterface<BookmarkNode, int64> { | 34 : public PerDataTypeAssociatorInterface<BookmarkNode, int64> { |
| 35 public: | 35 public: |
| 36 static syncable::ModelType model_type() { return syncable::BOOKMARKS; } | 36 static syncable::ModelType model_type() { return syncable::BOOKMARKS; } |
| 37 BookmarkModelAssociator( | 37 BookmarkModelAssociator( |
| 38 BookmarkModel* bookmark_model, | 38 BookmarkModel* bookmark_model, |
| 39 sync_api::UserShare* user_share, | 39 sync_api::UserShare* user_share, |
| 40 UnrecoverableErrorHandler* unrecoverable_error_handler); | 40 UnrecoverableErrorHandler* unrecoverable_error_handler); |
| 41 virtual ~BookmarkModelAssociator(); | 41 virtual ~BookmarkModelAssociator(); |
| 42 | 42 |
| 43 // Invokes BookmarkModel::SetMobileFolderVisible() based on whether the mobile | |
| 44 // node exists. | |
| 45 void UpdateMobileNodeVisibility(); | |
| 46 | |
| 47 // AssociatorInterface implementation. | 43 // AssociatorInterface implementation. |
| 48 // | 44 // |
| 49 // AssociateModels iterates through both the sync and the browser | 45 // AssociateModels iterates through both the sync and the browser |
| 50 // bookmark model, looking for matched pairs of items. For any pairs it | 46 // bookmark model, looking for matched pairs of items. For any pairs it |
| 51 // finds, it will call AssociateSyncID. For any unmatched items, | 47 // finds, it will call AssociateSyncID. For any unmatched items, |
| 52 // MergeAndAssociateModels will try to repair the match, e.g. by adding a new | 48 // MergeAndAssociateModels will try to repair the match, e.g. by adding a new |
| 53 // node. After successful completion, the models should be identical and | 49 // node. After successful completion, the models should be identical and |
| 54 // corresponding. Returns true on success. On failure of this step, we | 50 // corresponding. Returns true on success. On failure of this step, we |
| 55 // should abort the sync operation and report an error to the user. | 51 // should abort the sync operation and report an error to the user. |
| 56 virtual bool AssociateModels(SyncError* error) OVERRIDE; | 52 virtual bool AssociateModels(SyncError* error) OVERRIDE; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 ScopedRunnableMethodFactory<BookmarkModelAssociator> persist_associations_; | 136 ScopedRunnableMethodFactory<BookmarkModelAssociator> persist_associations_; |
| 141 | 137 |
| 142 int number_of_new_sync_nodes_created_at_association_; | 138 int number_of_new_sync_nodes_created_at_association_; |
| 143 | 139 |
| 144 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 140 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
| 145 }; | 141 }; |
| 146 | 142 |
| 147 } // namespace browser_sync | 143 } // namespace browser_sync |
| 148 | 144 |
| 149 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 145 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |