Commit b92e8e92 authored by Matthias Körber's avatar Matthias Körber Committed by Commit Bot

[Autofill][Leipzig] Fix enhanced profile propagation bug

Currently the AutofillProfile::Compare() method ignores the new address
tokens since those are not actively used by the profile. This results
in sync updates containing the enhanced address tokens not being
propagated to the local store.

With this CL the new address tokens are checked by
AutofillProfile::Compare().

For mergeabibility, the changes are entirely guarded by a finch flag.

Change-Id: Id1fac25642d32bfca4c484aa54655c57a3e851fe
Bug: 1129006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414272
Auto-Submit: Matthias Körber <koerber@google.com>
Commit-Queue: Christoph Schwering <schwering@google.com>
Reviewed-by: default avatarChristoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/master@{#807604}
parent e50295e3
...@@ -461,6 +461,30 @@ int AutofillProfile::Compare(const AutofillProfile& profile) const { ...@@ -461,6 +461,30 @@ int AutofillProfile::Compare(const AutofillProfile& profile) const {
return 1; return 1;
} }
if (base::FeatureList::IsEnabled(
features::kAutofillAddressEnhancementVotes)) {
const ServerFieldType new_types[] = {
ADDRESS_HOME_HOUSE_NUMBER,
ADDRESS_HOME_STREET_NAME,
ADDRESS_HOME_DEPENDENT_STREET_NAME,
ADDRESS_HOME_PREMISE_NAME,
ADDRESS_HOME_SUBPREMISE,
};
for (ServerFieldType type : new_types) {
int comparison = GetRawInfo(type).compare(profile.GetRawInfo(type));
if (comparison != 0) {
return comparison;
}
}
for (ServerFieldType type : new_types) {
if (GetVerificationStatus(type) < profile.GetVerificationStatus(type))
return -1;
if (GetVerificationStatus(type) > profile.GetVerificationStatus(type))
return 1;
}
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment