| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 virtual bool DisassociateModels(); | 55 virtual bool DisassociateModels(); |
| 56 | 56 |
| 57 // The has_nodes out param is true if the sync model has nodes other | 57 // The has_nodes out param is true if the sync model has nodes other |
| 58 // than the permanent tagged nodes. | 58 // than the permanent tagged nodes. |
| 59 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); | 59 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); |
| 60 | 60 |
| 61 // Returns sync id for the given bookmark node id. | 61 // Returns sync id for the given bookmark node id. |
| 62 // Returns sync_api::kInvalidId if the sync node is not found for the given | 62 // Returns sync_api::kInvalidId if the sync node is not found for the given |
| 63 // bookmark node id. | 63 // bookmark node id. |
| 64 virtual int64 GetSyncIdFromChromeId(int64 node_id); | 64 virtual int64 GetSyncIdFromChromeId(const int64& node_id); |
| 65 | 65 |
| 66 // Returns the bookmark node for the given sync id. | 66 // Returns the bookmark node for the given sync id. |
| 67 // Returns NULL if no bookmark node is found for the given sync id. | 67 // Returns NULL if no bookmark node is found for the given sync id. |
| 68 virtual const BookmarkNode* GetChromeNodeFromSyncId(int64 sync_id); | 68 virtual const BookmarkNode* GetChromeNodeFromSyncId(int64 sync_id); |
| 69 | 69 |
| 70 // Initializes the given sync node from the given bookmark node id. | 70 // Initializes the given sync node from the given bookmark node id. |
| 71 // Returns false if no sync node was found for the given bookmark node id or | 71 // Returns false if no sync node was found for the given bookmark node id or |
| 72 // if the initialization of sync node fails. | 72 // if the initialization of sync node fails. |
| 73 virtual bool InitSyncNodeFromChromeId(int64 node_id, | 73 virtual bool InitSyncNodeFromChromeId(const int64& node_id, |
| 74 sync_api::BaseNode* sync_node); | 74 sync_api::BaseNode* sync_node); |
| 75 | 75 |
| 76 // Associates the given bookmark node with the given sync id. | 76 // Associates the given bookmark node with the given sync id. |
| 77 virtual void Associate(const BookmarkNode* node, int64 sync_id); | 77 virtual void Associate(const BookmarkNode* node, int64 sync_id); |
| 78 // Remove the association that corresponds to the given sync id. | 78 // Remove the association that corresponds to the given sync id. |
| 79 virtual void Disassociate(int64 sync_id); | 79 virtual void Disassociate(int64 sync_id); |
| 80 | 80 |
| 81 virtual void AbortAssociation() { | 81 virtual void AbortAssociation() { |
| 82 // No implementation needed, this associator runs on the main | 82 // No implementation needed, this associator runs on the main |
| 83 // thread. | 83 // thread. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // guarantees no invocations can occur if |this| has been deleted. (This | 134 // guarantees no invocations can occur if |this| has been deleted. (This |
| 135 // allows this class to be non-refcounted). | 135 // allows this class to be non-refcounted). |
| 136 ScopedRunnableMethodFactory<BookmarkModelAssociator> persist_associations_; | 136 ScopedRunnableMethodFactory<BookmarkModelAssociator> persist_associations_; |
| 137 | 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 138 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace browser_sync | 141 } // namespace browser_sync |
| 142 | 142 |
| 143 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 143 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |