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 COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ | 5 #ifndef COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ |
6 #define COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ | 6 #define COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <stack> | 10 #include <stack> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // expect the mobile bookmarks permanent folder to be created. | 53 // expect the mobile bookmarks permanent folder to be created. |
54 // Should be set to true only by mobile clients. | 54 // Should be set to true only by mobile clients. |
55 BookmarkModelAssociator( | 55 BookmarkModelAssociator( |
56 bookmarks::BookmarkModel* bookmark_model, | 56 bookmarks::BookmarkModel* bookmark_model, |
57 sync_driver::SyncClient* sync_client, | 57 sync_driver::SyncClient* sync_client, |
58 syncer::UserShare* user_share, | 58 syncer::UserShare* user_share, |
59 sync_driver::DataTypeErrorHandler* unrecoverable_error_handler, | 59 sync_driver::DataTypeErrorHandler* unrecoverable_error_handler, |
60 bool expect_mobile_bookmarks_folder); | 60 bool expect_mobile_bookmarks_folder); |
61 ~BookmarkModelAssociator() override; | 61 ~BookmarkModelAssociator() override; |
62 | 62 |
63 // Updates the visibility of the permanents node in the BookmarkModel. | |
64 void UpdatePermanentNodeVisibility(); | |
65 | |
66 // AssociatorInterface implementation. | 63 // AssociatorInterface implementation. |
67 // | 64 // |
68 // AssociateModels iterates through both the sync and the browser | 65 // AssociateModels iterates through both the sync and the browser |
69 // bookmark model, looking for matched pairs of items. For any pairs it | 66 // bookmark model, looking for matched pairs of items. For any pairs it |
70 // finds, it will call AssociateSyncID. For any unmatched items, | 67 // finds, it will call AssociateSyncID. For any unmatched items, |
71 // MergeAndAssociateModels will try to repair the match, e.g. by adding a new | 68 // MergeAndAssociateModels will try to repair the match, e.g. by adding a new |
72 // node. After successful completion, the models should be identical and | 69 // node. After successful completion, the models should be identical and |
73 // corresponding. Returns true on success. On failure of this step, we | 70 // corresponding. Returns true on success. On failure of this step, we |
74 // should abort the sync operation and report an error to the user. | 71 // should abort the sync operation and report an error to the user. |
75 syncer::SyncError AssociateModels( | 72 syncer::SyncError AssociateModels( |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 // guarantees no invocations can occur if |this| has been deleted. (This | 316 // guarantees no invocations can occur if |this| has been deleted. (This |
320 // allows this class to be non-refcounted). | 317 // allows this class to be non-refcounted). |
321 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; | 318 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; |
322 | 319 |
323 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 320 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
324 }; | 321 }; |
325 | 322 |
326 } // namespace browser_sync | 323 } // namespace browser_sync |
327 | 324 |
328 #endif // COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ | 325 #endif // COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ |
OLD | NEW |