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_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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // bookmark node id. | 71 // bookmark node id. |
72 virtual int64 GetSyncIdFromChromeId(const int64& node_id) OVERRIDE; | 72 virtual int64 GetSyncIdFromChromeId(const int64& node_id) OVERRIDE; |
73 | 73 |
74 // Returns the bookmark node for the given sync id. | 74 // Returns the bookmark node for the given sync id. |
75 // Returns NULL if no bookmark node is found for the given sync id. | 75 // Returns NULL if no bookmark node is found for the given sync id. |
76 virtual const BookmarkNode* GetChromeNodeFromSyncId(int64 sync_id) OVERRIDE; | 76 virtual const BookmarkNode* GetChromeNodeFromSyncId(int64 sync_id) OVERRIDE; |
77 | 77 |
78 // Initializes the given sync node from the given bookmark node id. | 78 // Initializes the given sync node from the given bookmark node id. |
79 // Returns false if no sync node was found for the given bookmark node id or | 79 // Returns false if no sync node was found for the given bookmark node id or |
80 // if the initialization of sync node fails. | 80 // if the initialization of sync node fails. |
81 virtual bool InitSyncNodeFromChromeId(const int64& node_id, | 81 virtual bool InitSyncNodeFromChromeId( |
82 sync_api::BaseNode* sync_node) OVERRIDE; | 82 const int64& node_id, |
| 83 sync_api::BaseNode* sync_node) OVERRIDE; |
83 | 84 |
84 // Associates the given bookmark node with the given sync id. | 85 // Associates the given bookmark node with the given sync id. |
85 virtual void Associate(const BookmarkNode* node, int64 sync_id) OVERRIDE; | 86 virtual void Associate(const BookmarkNode* node, int64 sync_id) OVERRIDE; |
86 // Remove the association that corresponds to the given sync id. | 87 // Remove the association that corresponds to the given sync id. |
87 virtual void Disassociate(int64 sync_id) OVERRIDE; | 88 virtual void Disassociate(int64 sync_id) OVERRIDE; |
88 | 89 |
89 virtual void AbortAssociation() OVERRIDE { | 90 virtual void AbortAssociation() OVERRIDE { |
90 // No implementation needed, this associator runs on the main | 91 // No implementation needed, this associator runs on the main |
91 // thread. | 92 // thread. |
92 } | 93 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; | 148 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; |
148 | 149 |
149 int number_of_new_sync_nodes_created_at_association_; | 150 int number_of_new_sync_nodes_created_at_association_; |
150 | 151 |
151 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 152 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
152 }; | 153 }; |
153 | 154 |
154 } // namespace browser_sync | 155 } // namespace browser_sync |
155 | 156 |
156 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 157 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
OLD | NEW |