OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 4 #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
5 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 5 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
6 #pragma once | 6 #pragma once |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 // Syncs |change| to the cloud. | 123 // Syncs |change| to the cloud. |
124 void ActOnChange(const AutofillProfileChange& change); | 124 void ActOnChange(const AutofillProfileChange& change); |
125 | 125 |
126 // Creates SyncData based on supplied |profile|. | 126 // Creates SyncData based on supplied |profile|. |
127 static SyncData CreateData(const AutofillProfile& profile); | 127 static SyncData CreateData(const AutofillProfile& profile); |
128 | 128 |
129 // For unit-tests. | 129 // For unit-tests. |
130 AutofillProfileSyncableService(); | 130 AutofillProfileSyncableService(); |
131 void set_sync_processor(SyncChangeProcessor* sync_processor) { | 131 void set_sync_processor(SyncChangeProcessor* sync_processor) { |
132 sync_processor_ = sync_processor; | 132 sync_processor_.reset(sync_processor); |
133 } | 133 } |
134 | 134 |
135 WebDatabase* web_database_; | 135 WebDatabase* web_database_; |
136 Profile* profile_; | 136 Profile* profile_; |
137 NotificationRegistrar notification_registrar_; | 137 NotificationRegistrar notification_registrar_; |
138 | 138 |
139 // Cached Autofill profiles. *Warning* deleted profiles are still in the | 139 // Cached Autofill profiles. *Warning* deleted profiles are still in the |
140 // vector - use the |profiles_map_| to iterate through actual profiles. | 140 // vector - use the |profiles_map_| to iterate through actual profiles. |
141 ScopedVector<AutofillProfile> profiles_; | 141 ScopedVector<AutofillProfile> profiles_; |
142 GUIDToProfileMap profiles_map_; | 142 GUIDToProfileMap profiles_map_; |
143 | 143 |
144 SyncChangeProcessor* sync_processor_; | 144 scoped_ptr<SyncChangeProcessor> sync_processor_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(AutofillProfileSyncableService); | 146 DISALLOW_COPY_AND_ASSIGN(AutofillProfileSyncableService); |
147 }; | 147 }; |
148 | 148 |
149 // This object is used in unit-tests as well, so it defined here. | 149 // This object is used in unit-tests as well, so it defined here. |
150 struct AutofillProfileSyncableService::DataBundle { | 150 struct AutofillProfileSyncableService::DataBundle { |
151 DataBundle(); | 151 DataBundle(); |
152 ~DataBundle(); | 152 ~DataBundle(); |
153 | 153 |
154 std::vector<std::string> profiles_to_delete; | 154 std::vector<std::string> profiles_to_delete; |
155 std::vector<AutofillProfile*> profiles_to_update; | 155 std::vector<AutofillProfile*> profiles_to_update; |
156 std::vector<AutofillProfile*> profiles_to_add; | 156 std::vector<AutofillProfile*> profiles_to_add; |
157 }; | 157 }; |
158 | 158 |
159 } // namespace browser_sync | 159 } // namespace browser_sync |
160 | 160 |
161 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 161 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
OLD | NEW |