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_PREFERENCE_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_PREFERENCE_MODEL_ASSOCIATOR_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_PREFERENCE_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_PREFERENCE_MODEL_ASSOCIATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Returns whether the sync model has nodes other than the permanent tagged | 63 // Returns whether the sync model has nodes other than the permanent tagged |
64 // nodes. | 64 // nodes. |
65 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); | 65 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); |
66 | 66 |
67 virtual void AbortAssociation() { | 67 virtual void AbortAssociation() { |
68 // No implementation needed, this associator runs on the main | 68 // No implementation needed, this associator runs on the main |
69 // thread. | 69 // thread. |
70 } | 70 } |
71 | 71 |
72 // Not implemented. | 72 // Not implemented. |
73 virtual const PrefService::Preference* GetChromeNodeFromSyncId( | 73 virtual const PrefService::Preference* GetChromeNodeFromSyncId(int64 sync_id); |
74 int64 sync_id) { | |
75 return NULL; | |
76 } | |
77 | 74 |
78 // Not implemented. | 75 // Not implemented. |
79 virtual bool InitSyncNodeFromChromeId(const std::string& node_id, | 76 virtual bool InitSyncNodeFromChromeId(const std::string& node_id, |
80 sync_api::BaseNode* sync_node) { | 77 sync_api::BaseNode* sync_node); |
81 return false; | |
82 } | |
83 | 78 |
84 // Returns the sync id for the given preference name, or sync_api::kInvalidId | 79 // Returns the sync id for the given preference name, or sync_api::kInvalidId |
85 // if the preference name is not associated to any sync id. | 80 // if the preference name is not associated to any sync id. |
86 virtual int64 GetSyncIdFromChromeId(const std::string& node_id); | 81 virtual int64 GetSyncIdFromChromeId(const std::string& node_id); |
87 | 82 |
88 // Associates the given preference name with the given sync id. | 83 // Associates the given preference name with the given sync id. |
89 virtual void Associate(const PrefService::Preference* node, int64 sync_id); | 84 virtual void Associate(const PrefService::Preference* node, int64 sync_id); |
90 | 85 |
91 // Remove the association that corresponds to the given sync id. | 86 // Remove the association that corresponds to the given sync id. |
92 virtual void Disassociate(int64 sync_id); | 87 virtual void Disassociate(int64 sync_id); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 127 |
133 PreferenceNameToSyncIdMap id_map_; | 128 PreferenceNameToSyncIdMap id_map_; |
134 SyncIdToPreferenceNameMap id_map_inverse_; | 129 SyncIdToPreferenceNameMap id_map_inverse_; |
135 | 130 |
136 DISALLOW_COPY_AND_ASSIGN(PreferenceModelAssociator); | 131 DISALLOW_COPY_AND_ASSIGN(PreferenceModelAssociator); |
137 }; | 132 }; |
138 | 133 |
139 } // namespace browser_sync | 134 } // namespace browser_sync |
140 | 135 |
141 #endif // CHROME_BROWSER_SYNC_GLUE_PREFERENCE_MODEL_ASSOCIATOR_H_ | 136 #endif // CHROME_BROWSER_SYNC_GLUE_PREFERENCE_MODEL_ASSOCIATOR_H_ |
OLD | NEW |