Chromium Code Reviews| Index: components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| diff --git a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| index 6e444546f1116fb8038335cffdd96f8b6e56c8d4..4120264bfff59766d280cde67a3ddcc0eccf0850 100644 |
| --- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| +++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| @@ -142,7 +142,8 @@ AutofillProfileSyncableService::MergeDataAndStartSyncing( |
| remaining_profiles.find(it.first); |
| if (profile_to_merge != remaining_profiles.end()) { |
| bundle.profiles_to_delete.push_back(profile_to_merge->second->guid()); |
|
Mathieu
2016/04/22 20:54:28
Let's add a comment: // For similar profile pairs,
sebsg
2016/04/25 15:35:39
Done.
|
| - if (MergeProfile(*(profile_to_merge->second), it.second, app_locale_)) |
| + if (MergeSimilarProfile(*(profile_to_merge->second), it.second, |
|
Mathieu
2016/04/22 20:54:28
Let's add a comment: if new changes were merged in
sebsg
2016/04/25 15:35:39
Done.
|
| + app_locale_)) |
| bundle.profiles_to_sync_back.push_back(it.second); |
| DVLOG(2) << "[AUTOFILL SYNC]" |
| << "Found similar profile in sync db but with a different guid: " |
| @@ -627,13 +628,14 @@ bool AutofillProfileSyncableService::UpdateField( |
| return true; |
| } |
| -bool AutofillProfileSyncableService::MergeProfile( |
| +bool AutofillProfileSyncableService::MergeSimilarProfile( |
| const AutofillProfile& merge_from, |
| AutofillProfile* merge_into, |
| const std::string& app_locale) { |
| + AutofillProfile old_merge_into = *merge_into; |
|
Mathieu
2016/04/22 20:54:28
const?
sebsg
2016/04/25 15:35:39
Done.
|
| // Overwrites all values. Does not overwrite GUID. |
| merge_into->OverwriteWith(merge_from, app_locale); |
| - return !merge_into->EqualsForSyncPurposes(merge_from); |
| + return !merge_into->EqualsForSyncPurposes(old_merge_into); |
| } |
| AutofillTable* AutofillProfileSyncableService::GetAutofillTable() const { |