| 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_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/lock.h" | |
| 16 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
| 16 #include "base/synchronization/lock.h" |
| 17 #include "chrome/browser/autofill/personal_data_manager.h" | 17 #include "chrome/browser/autofill/personal_data_manager.h" |
| 18 #include "chrome/browser/sync/engine/syncapi.h" | 18 #include "chrome/browser/sync/engine/syncapi.h" |
| 19 #include "chrome/browser/sync/glue/model_associator.h" | 19 #include "chrome/browser/sync/glue/model_associator.h" |
| 20 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" | 20 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" |
| 21 #include "chrome/browser/webdata/autofill_entry.h" | 21 #include "chrome/browser/webdata/autofill_entry.h" |
| 22 | 22 |
| 23 class AutoFillProfile; | 23 class AutoFillProfile; |
| 24 | 24 |
| 25 class ProfileSyncService; | 25 class ProfileSyncService; |
| 26 class WebDatabase; | 26 class WebDatabase; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 WebDatabase* web_database_; | 168 WebDatabase* web_database_; |
| 169 PersonalDataManager* personal_data_; | 169 PersonalDataManager* personal_data_; |
| 170 int64 autofill_node_id_; | 170 int64 autofill_node_id_; |
| 171 | 171 |
| 172 AutofillToSyncIdMap id_map_; | 172 AutofillToSyncIdMap id_map_; |
| 173 SyncIdToAutofillMap id_map_inverse_; | 173 SyncIdToAutofillMap id_map_inverse_; |
| 174 | 174 |
| 175 // Abort association pending flag and lock. If this is set to true | 175 // Abort association pending flag and lock. If this is set to true |
| 176 // (via the AbortAssociation method), return from the | 176 // (via the AbortAssociation method), return from the |
| 177 // AssociateModels method as soon as possible. | 177 // AssociateModels method as soon as possible. |
| 178 Lock abort_association_pending_lock_; | 178 base::Lock abort_association_pending_lock_; |
| 179 bool abort_association_pending_; | 179 bool abort_association_pending_; |
| 180 | 180 |
| 181 int number_of_profiles_created_; | 181 int number_of_profiles_created_; |
| 182 | 182 |
| 183 DISALLOW_COPY_AND_ASSIGN(AutofillProfileModelAssociator); | 183 DISALLOW_COPY_AND_ASSIGN(AutofillProfileModelAssociator); |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 struct AutofillProfileModelAssociator::DataBundle { | 186 struct AutofillProfileModelAssociator::DataBundle { |
| 187 std::set<std::string> current_profiles; | 187 std::set<std::string> current_profiles; |
| 188 std::vector<std::string> profiles_to_delete; | 188 std::vector<std::string> profiles_to_delete; |
| 189 std::vector<AutoFillProfile*> updated_profiles; | 189 std::vector<AutoFillProfile*> updated_profiles; |
| 190 std::vector<AutoFillProfile*> new_profiles; // We own these pointers. | 190 std::vector<AutoFillProfile*> new_profiles; // We own these pointers. |
| 191 ~DataBundle() { STLDeleteElements(&new_profiles); } | 191 ~DataBundle() { STLDeleteElements(&new_profiles); } |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 } // namespace browser_sync | 194 } // namespace browser_sync |
| 195 | 195 |
| 196 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_ | 196 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_ |
| 197 | 197 |
| OLD | NEW |