Commit ba345648 authored by Jared Saul's avatar Jared Saul Committed by Commit Bot

Remove AutofillUpstreamUseAutofillProfileComparator experiment

Bug: 
Change-Id: Iec0429a3149ee17ca53b60224684e4dc3e6bbf26
Reviewed-on: https://chromium-review.googlesource.com/828442
Commit-Queue: Jared Saul <jsaul@google.com>
Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524435}
parent 7e9579c8
......@@ -69,9 +69,6 @@ const base::Feature kAutofillUpstreamSendDetectedValues{
"AutofillUpstreamSendDetectedValues", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAutofillUpstreamSendPanFirstSix{
"AutofillUpstreamSendPanFirstSix", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAutofillUpstreamUseAutofillProfileComparator{
"AutofillUpstreamUseAutofillProfileComparator",
base::FEATURE_DISABLED_BY_DEFAULT};
const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit";
const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color";
const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color";
......
......@@ -46,7 +46,6 @@ extern const base::Feature kAutofillUpstreamAllowAllEmailDomains;
extern const base::Feature kAutofillUpstreamRequestCvcIfMissing;
extern const base::Feature kAutofillUpstreamSendDetectedValues;
extern const base::Feature kAutofillUpstreamSendPanFirstSix;
extern const base::Feature kAutofillUpstreamUseAutofillProfileComparator;
extern const char kCreditCardSigninPromoImpressionLimitParamKey[];
extern const char kAutofillCreditCardLastUsedDateShowExpirationDateKey[];
extern const char kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey[];
......
......@@ -27,7 +27,6 @@
#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/autofill_metrics.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/autofill_profile_comparator.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/form_structure.h"
......@@ -330,12 +329,6 @@ void CreditCardSaveManager::SetProfilesForCreditCardUpload(
: AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE;
}
std::unique_ptr<AutofillProfileComparator> comparator;
if (!candidate_profiles.empty() &&
(base::FeatureList::IsEnabled(
kAutofillUpstreamUseAutofillProfileComparator)))
comparator = std::make_unique<AutofillProfileComparator>(app_locale_);
// If any of the names on the card or the addresses don't match the
// candidate set is invalid. This matches the rules for name matching applied
// server-side by Google Payments and ensures that we don't send upload
......@@ -347,37 +340,18 @@ void CreditCardSaveManager::SetProfilesForCreditCardUpload(
verified_name = card_name;
} else {
bool found_conflicting_names = false;
if (comparator) {
upload_request->active_experiments.push_back(
kAutofillUpstreamUseAutofillProfileComparator.name);
verified_name = comparator->NormalizeForComparison(card_name);
for (const AutofillProfile& profile : candidate_profiles) {
const base::string16 address_name = comparator->NormalizeForComparison(
profile.GetInfo(NAME_FULL, app_locale_));
if (address_name.empty())
continue;
if (verified_name.empty() ||
comparator->IsNameVariantOf(address_name, verified_name)) {
verified_name = address_name;
} else if (!comparator->IsNameVariantOf(verified_name, address_name)) {
found_conflicting_names = true;
break;
}
}
} else {
verified_name = RemoveMiddleInitial(card_name);
for (const AutofillProfile& profile : candidate_profiles) {
const base::string16 address_name =
RemoveMiddleInitial(profile.GetInfo(NAME_FULL, app_locale_));
if (address_name.empty())
continue;
if (verified_name.empty()) {
verified_name = address_name;
} else if (!base::EqualsCaseInsensitiveASCII(verified_name,
address_name)) {
found_conflicting_names = true;
break;
}
verified_name = RemoveMiddleInitial(card_name);
for (const AutofillProfile& profile : candidate_profiles) {
const base::string16 address_name =
RemoveMiddleInitial(profile.GetInfo(NAME_FULL, app_locale_));
if (address_name.empty())
continue;
if (verified_name.empty()) {
verified_name = address_name;
} else if (!base::EqualsCaseInsensitiveASCII(verified_name,
address_name)) {
found_conflicting_names = true;
break;
}
}
if (found_conflicting_names) {
......@@ -395,29 +369,12 @@ void CreditCardSaveManager::SetProfilesForCreditCardUpload(
// If any of the candidate addresses have a non-empty zip that doesn't match
// any other non-empty zip, then the candidate set is invalid.
base::string16 verified_zip;
base::string16 normalized_verified_zip;
const AutofillType kZipCode(ADDRESS_HOME_ZIP);
for (const AutofillProfile& profile : candidate_profiles) {
const base::string16 zip = comparator
? profile.GetInfo(kZipCode, app_locale_)
: profile.GetRawInfo(ADDRESS_HOME_ZIP);
const base::string16 normalized_zip =
comparator ? comparator->NormalizeForComparison(
zip, AutofillProfileComparator::DISCARD_WHITESPACE)
: base::string16();
const base::string16 zip = profile.GetRawInfo(ADDRESS_HOME_ZIP);
if (!zip.empty()) {
if (verified_zip.empty()) {
verified_zip = zip;
normalized_verified_zip = normalized_zip;
} else if (comparator) {
if (normalized_zip.find(normalized_verified_zip) ==
base::string16::npos &&
normalized_verified_zip.find(normalized_zip) ==
base::string16::npos) {
upload_decision_metrics_ |=
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_ZIPS;
break;
}
} else {
// To compare two zips, we check to see if either is a prefix of the
// other. This allows us to consider a 5-digit zip and a zip+4 to be a
......
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