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_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 4 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
5 #define CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 5 #define CHROME_BROWSER_WEBDATA_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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 void ActOnChange(const AutofillProfileChange& change); | 123 void ActOnChange(const AutofillProfileChange& change); |
124 | 124 |
125 // Creates SyncData based on supplied |profile|. | 125 // Creates SyncData based on supplied |profile|. |
126 static SyncData CreateData(const AutofillProfile& profile); | 126 static SyncData CreateData(const AutofillProfile& profile); |
127 | 127 |
128 AutofillTable* GetAutofillTable() const; | 128 AutofillTable* GetAutofillTable() const; |
129 | 129 |
130 // For unit-tests. | 130 // For unit-tests. |
131 AutofillProfileSyncableService(); | 131 AutofillProfileSyncableService(); |
132 void set_sync_processor(SyncChangeProcessor* sync_processor) { | 132 void set_sync_processor(SyncChangeProcessor* sync_processor) { |
133 sync_processor_ = sync_processor; | 133 sync_processor_.reset(sync_processor); |
134 } | 134 } |
135 | 135 |
136 WebDataService* web_data_service_; // WEAK | 136 WebDataService* web_data_service_; // WEAK |
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 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 159 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
OLD | NEW |