Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1742)

Unified Diff: components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc

Issue 1989173005: [Autofill] Dedupe similar profiles on insertion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/personal_data_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b150b38dd318ca196c64ca4d9b9285c8defe2f01..fc8aa708d821532f88052cc25d66223eecf3e02f 100644
--- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc
+++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc
@@ -542,14 +542,19 @@ AutofillProfileSyncableService::CreateOrUpdateProfile(
<< ". Profile to be deleted " << local_profile->guid();
profile_map->erase(it);
break;
- } else if (!local_profile->IsVerified() &&
- !new_profile->IsVerified() &&
- !local_profile->PrimaryValue().empty() &&
- local_profile->PrimaryValue() == new_profile->PrimaryValue()) {
- // Add it to candidates for merge - if there is no profile with this
- // guid we will merge them.
- bundle->candidates_to_merge.insert(
- std::make_pair(local_profile->guid(), new_profile));
+ } else {
+ if (!local_profile->IsVerified() && !new_profile->IsVerified()) {
+ base::string16 local_profile_primary_value(
+ local_profile->PrimaryValue(app_locale_));
+ if (!local_profile_primary_value.empty() &&
+ local_profile_primary_value ==
+ new_profile->PrimaryValue(app_locale_)) {
+ // Add it to candidates for merge - if there is no profile with this
+ // guid we will merge them.
+ bundle->candidates_to_merge.insert(
+ std::make_pair(local_profile->guid(), new_profile));
+ }
+ }
}
}
profiles_.push_back(new_profile);
« no previous file with comments | « components/autofill/core/browser/personal_data_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698