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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( |
74 int64 sync_id) { | 74 int64 sync_id) { |
75 return NULL; | 75 return NULL; |
76 } | 76 } |
77 | 77 |
78 // Not implemented. | 78 // Not implemented. |
79 virtual bool InitSyncNodeFromChromeId(std::string node_id, | 79 virtual bool InitSyncNodeFromChromeId(const std::string& node_id, |
80 sync_api::BaseNode* sync_node) { | 80 sync_api::BaseNode* sync_node) { |
81 return false; | 81 return false; |
82 } | 82 } |
83 | 83 |
84 // Returns the sync id for the given preference name, or sync_api::kInvalidId | 84 // 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. | 85 // if the preference name is not associated to any sync id. |
86 virtual int64 GetSyncIdFromChromeId(std::string node_id); | 86 virtual int64 GetSyncIdFromChromeId(const std::string& node_id); |
87 | 87 |
88 // Associates the given preference name with the given sync id. | 88 // Associates the given preference name with the given sync id. |
89 virtual void Associate(const PrefService::Preference* node, int64 sync_id); | 89 virtual void Associate(const PrefService::Preference* node, int64 sync_id); |
90 | 90 |
91 // Remove the association that corresponds to the given sync id. | 91 // Remove the association that corresponds to the given sync id. |
92 virtual void Disassociate(int64 sync_id); | 92 virtual void Disassociate(int64 sync_id); |
93 | 93 |
94 // Returns whether a node with the given permanent tag was found and update | 94 // Returns whether a node with the given permanent tag was found and update |
95 // |sync_id| with that node's id. | 95 // |sync_id| with that node's id. |
96 virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id); | 96 virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 PreferenceNameToSyncIdMap id_map_; | 133 PreferenceNameToSyncIdMap id_map_; |
134 SyncIdToPreferenceNameMap id_map_inverse_; | 134 SyncIdToPreferenceNameMap id_map_inverse_; |
135 | 135 |
136 DISALLOW_COPY_AND_ASSIGN(PreferenceModelAssociator); | 136 DISALLOW_COPY_AND_ASSIGN(PreferenceModelAssociator); |
137 }; | 137 }; |
138 | 138 |
139 } // namespace browser_sync | 139 } // namespace browser_sync |
140 | 140 |
141 #endif // CHROME_BROWSER_SYNC_GLUE_PREFERENCE_MODEL_ASSOCIATOR_H_ | 141 #endif // CHROME_BROWSER_SYNC_GLUE_PREFERENCE_MODEL_ASSOCIATOR_H_ |
OLD | NEW |