| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVI
CE_H_ | 4 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVI
CE_H_ |
| 5 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVI
CE_H_ | 5 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVI
CE_H_ |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/scoped_observer.h" | 15 #include "base/scoped_observer.h" |
| 16 #include "base/supports_user_data.h" | 16 #include "base/supports_user_data.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
| 19 #include "components/autofill/core/browser/field_types.h" | 19 #include "components/autofill/core/browser/field_types.h" |
| 20 #include "components/autofill/core/browser/webdata/autofill_change.h" | 20 #include "components/autofill/core/browser/webdata/autofill_change.h" |
| 21 #include "components/autofill/core/browser/webdata/autofill_entry.h" | 21 #include "components/autofill/core/browser/webdata/autofill_entry.h" |
| 22 #include "components/autofill/core/browser/webdata/autofill_webdata_backend.h" | 22 #include "components/autofill/core/browser/webdata/autofill_webdata_backend.h" |
| 23 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse
rver.h" | 23 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse
rver.h" |
| 24 #include "components/sync/api/sync_change.h" | 24 #include "components/sync/api/sync_change.h" |
| 25 #include "components/sync/api/sync_data.h" | 25 #include "components/sync/api/sync_data.h" |
| 26 #include "components/sync/api/sync_error.h" | 26 #include "components/sync/api/sync_error.h" |
| 27 #include "components/sync/api/syncable_service.h" | 27 #include "components/sync/api/syncable_service.h" |
| 28 #include "components/sync/protocol/autofill_specifics.pb.h" | 28 #include "components/sync/protocol/autofill_specifics.pb.h" |
| 29 | 29 |
| 30 namespace browser_sync { |
| 30 class ProfileSyncServiceAutofillTest; | 31 class ProfileSyncServiceAutofillTest; |
| 32 } // namespace browser_sync |
| 31 | 33 |
| 32 namespace autofill { | 34 namespace autofill { |
| 33 | 35 |
| 34 class AutofillProfile; | 36 class AutofillProfile; |
| 35 class AutofillTable; | 37 class AutofillTable; |
| 36 class AutofillWebDataService; | 38 class AutofillWebDataService; |
| 37 | 39 |
| 38 extern const char kAutofillProfileTag[]; | 40 extern const char kAutofillProfileTag[]; |
| 39 | 41 |
| 40 // The sync implementation for local AutofillProfiles, which can be managed in | 42 // The sync implementation for local AutofillProfiles, which can be managed in |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 AutofillProfileSyncableService(); | 112 AutofillProfileSyncableService(); |
| 111 void set_sync_processor(syncer::SyncChangeProcessor* sync_processor) { | 113 void set_sync_processor(syncer::SyncChangeProcessor* sync_processor) { |
| 112 sync_processor_.reset(sync_processor); | 114 sync_processor_.reset(sync_processor); |
| 113 } | 115 } |
| 114 | 116 |
| 115 // Creates syncer::SyncData based on supplied |profile|. | 117 // Creates syncer::SyncData based on supplied |profile|. |
| 116 // Exposed for unit tests. | 118 // Exposed for unit tests. |
| 117 static syncer::SyncData CreateData(const AutofillProfile& profile); | 119 static syncer::SyncData CreateData(const AutofillProfile& profile); |
| 118 | 120 |
| 119 private: | 121 private: |
| 120 friend class ::ProfileSyncServiceAutofillTest; | 122 friend class browser_sync::ProfileSyncServiceAutofillTest; |
| 121 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, | 123 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, |
| 122 UpdateField); | 124 UpdateField); |
| 123 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, | 125 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, |
| 124 MergeSimilarProfiles_AdditionalInfoInBothProfiles); | 126 MergeSimilarProfiles_AdditionalInfoInBothProfiles); |
| 125 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, | 127 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, |
| 126 MergeSimilarProfiles_DifferentUseDates); | 128 MergeSimilarProfiles_DifferentUseDates); |
| 127 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, | 129 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, |
| 128 MergeSimilarProfiles_DifferentNames); | 130 MergeSimilarProfiles_DifferentNames); |
| 129 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, | 131 FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest, |
| 130 MergeSimilarProfiles_NonZeroUseCounts); | 132 MergeSimilarProfiles_NonZeroUseCounts); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // When we go through sync we find profiles that are similar but unmatched. | 210 // When we go through sync we find profiles that are similar but unmatched. |
| 209 // Merge such profiles. | 211 // Merge such profiles. |
| 210 GUIDToProfileMap candidates_to_merge; | 212 GUIDToProfileMap candidates_to_merge; |
| 211 // Profiles that have multi-valued fields that are not in sync. | 213 // Profiles that have multi-valued fields that are not in sync. |
| 212 std::vector<AutofillProfile*> profiles_to_sync_back; | 214 std::vector<AutofillProfile*> profiles_to_sync_back; |
| 213 }; | 215 }; |
| 214 | 216 |
| 215 } // namespace autofill | 217 } // namespace autofill |
| 216 | 218 |
| 217 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SE
RVICE_H_ | 219 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SE
RVICE_H_ |
| OLD | NEW |