Clean up kAutofillCreditCardBankNameDisplay flag
Bug: 812710
Change-Id: I4344c258668c5017a0a145e487ca2eb526bd49bc
Reviewed-on: https://chromium-review.googlesource.com/923281
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Jared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#537368}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 4106f249..7cc9e0a 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2904,10 +2904,6 @@
flag_descriptions::kEnableAutofillCreditCardAblationExperimentDescription,
kOsAll,
FEATURE_VALUE_TYPE(autofill::kAutofillCreditCardAblationExperiment)},
- {"enable-autofill-credit-card-bank-name-display",
- flag_descriptions::kEnableAutofillCreditCardBankNameDisplayName,
- flag_descriptions::kEnableAutofillCreditCardBankNameDisplayDescription,
- kOsAll, FEATURE_VALUE_TYPE(autofill::kAutofillCreditCardBankNameDisplay)},
{"enable-autofill-credit-card-dropdown-google-pay-branding",
flag_descriptions::kEnableAutofillCreditCardDropdownGooglePayBrandingName,
flag_descriptions::
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 3433659..4aa2db93 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -279,11 +279,6 @@
const char kEnableAutofillCreditCardAblationExperimentDescription[] =
"If enabled, credit card autofill suggestions will not display.";
-const char kEnableAutofillCreditCardBankNameDisplayName[] =
- "Display the issuer bank name of a credit card in autofill.";
-const char kEnableAutofillCreditCardBankNameDisplayDescription[] =
- "If enabled, displays the issuer bank name of a credit card in autofill.";
-
const char kEnableAutofillCreditCardDropdownGooglePayBrandingName[] =
"Show the Google Pay logo in the Autofill credit card dropdown";
const char kEnableAutofillCreditCardDropdownGooglePayBrandingDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 26f455d..a67eae3 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -203,9 +203,6 @@
extern const char kEnableAutofillCreditCardAblationExperimentDisplayName[];
extern const char kEnableAutofillCreditCardAblationExperimentDescription[];
-extern const char kEnableAutofillCreditCardBankNameDisplayName[];
-extern const char kEnableAutofillCreditCardBankNameDisplayDescription[];
-
extern const char kEnableAutofillCreditCardDropdownGooglePayBrandingName[];
extern const char
kEnableAutofillCreditCardDropdownGooglePayBrandingDescription[];
diff --git a/components/autofill/core/browser/autofill_experiments.cc b/components/autofill/core/browser/autofill_experiments.cc
index 170c5eb..4ce7fe7 100644
--- a/components/autofill/core/browser/autofill_experiments.cc
+++ b/components/autofill/core/browser/autofill_experiments.cc
@@ -32,8 +32,6 @@
"AutofillCreditCardAssist", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAutofillScanCardholderName{
"AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT};
-const base::Feature kAutofillCreditCardBankNameDisplay{
- "AutofillCreditCardBankNameDisplay", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAutofillCreditCardAblationExperiment{
"AutofillCreditCardAblationExperiment", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAutofillCreditCardPopupLayout{
@@ -123,10 +121,6 @@
return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay);
}
-bool IsAutofillCreditCardBankNameDisplayExperimentEnabled() {
- return base::FeatureList::IsEnabled(kAutofillCreditCardBankNameDisplay);
-}
-
// |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is
// not specified. 0 == |SK_ColorTRANSPARENT|.
SkColor GetCreditCardPopupBackgroundColor() {
diff --git a/components/autofill/core/browser/autofill_experiments.h b/components/autofill/core/browser/autofill_experiments.h
index 116824d..aa97a20 100644
--- a/components/autofill/core/browser/autofill_experiments.h
+++ b/components/autofill/core/browser/autofill_experiments.h
@@ -30,7 +30,6 @@
extern const base::Feature kAutofillCreditCardAssist;
extern const base::Feature kAutofillScanCardholderName;
extern const base::Feature kAutofillCreditCardAblationExperiment;
-extern const base::Feature kAutofillCreditCardBankNameDisplay;
extern const base::Feature kAutofillCreditCardPopupLayout;
extern const base::Feature kAutofillCreditCardLastUsedDateDisplay;
extern const base::Feature kAutofillDeleteDisusedAddresses;
@@ -88,9 +87,6 @@
// Returns whether Autofill credit card last used date shows expiration date.
bool ShowExpirationDateInAutofillCreditCardLastUsedDate();
-// Returns whether Autofill credit card bank name display experiment is enabled.
-bool IsAutofillCreditCardBankNameDisplayExperimentEnabled();
-
// Returns the background color for credit card autofill popup, or
// |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment
// is not enabled.
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index 4788afc..a11c463 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -756,11 +756,8 @@
}
base::string16 CreditCard::NetworkOrBankNameAndLastFourDigits() const {
- if (IsAutofillCreditCardBankNameDisplayExperimentEnabled() &&
- !bank_name_.empty()) {
- return BankNameAndLastFourDigits();
- }
- return NetworkAndLastFourDigits();
+ return bank_name_.empty() ? NetworkAndLastFourDigits()
+ : BankNameAndLastFourDigits();
}
base::string16 CreditCard::AbbreviatedExpirationDateForDisplay() const {
diff --git a/components/autofill/core/browser/credit_card_unittest.cc b/components/autofill/core/browser/credit_card_unittest.cc
index 99b28bf0..560b9d4 100644
--- a/components/autofill/core/browser/credit_card_unittest.cc
+++ b/components/autofill/core/browser/credit_card_unittest.cc
@@ -8,7 +8,6 @@
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/autofill/core/browser/autofill_experiments.h"
@@ -189,24 +188,7 @@
// Tests function NetworkOrBankNameAndLastFourDigits.
TEST(CreditCardTest, NetworkOrBankNameAndLastFourDigitsStrings) {
- // Case 1: Experiment off -> show network name.
- CreditCard credit_card1(base::GenerateGUID(), "https://www.example.com/");
- test::SetCreditCardInfo(&credit_card1, "John Dillinger",
- "5105 1051 0510 5100" /* Mastercard */, "01", "2010",
- "1");
- credit_card1.set_bank_name("Chase");
- base::string16 obfuscated1 =
- credit_card1.NetworkOrBankNameAndLastFourDigits();
- EXPECT_FALSE(credit_card1.bank_name().empty());
- EXPECT_EQ(
- UTF8ToUTF16(std::string("Mastercard") + kUTF8MidlineEllipsis + "5100"),
- obfuscated1);
-
- // Turn on feature flag.
- base::test::ScopedFeatureList scoped_feature_list_;
- scoped_feature_list_.InitAndEnableFeature(kAutofillCreditCardBankNameDisplay);
-
- // Case 2: Bank name is empty -> show network name.
+ // Case 1: Bank name is empty -> show network name.
CreditCard credit_card2(base::GenerateGUID(), "https://www.example.com/");
test::SetCreditCardInfo(&credit_card2, "John Dillinger",
"5105 1051 0510 5100" /* Mastercard */, "01", "2010",
@@ -218,7 +200,7 @@
UTF8ToUTF16(std::string("Mastercard") + kUTF8MidlineEllipsis + "5100"),
obfuscated2);
- // Case 3: Experiment on && bank name not empty -> show bank name.
+ // Case 2: Bank name is not empty -> show bank name.
CreditCard credit_card3(base::GenerateGUID(), "https://www.example.com/");
test::SetCreditCardInfo(&credit_card3, "John Dillinger",
"5105 1051 0510 5100" /* Mastercard */, "01", "2010",
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
index c8601ef..823e27c 100644
--- a/components/autofill/core/browser/personal_data_manager_unittest.cc
+++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -2531,14 +2531,9 @@
ASSERT_EQ(3U, suggestions.size());
}
-// Tests that server cards will show bank name when bank name is available and
-// feature flag on.
+// Tests that server cards will show bank name when bank name is available.
TEST_F(PersonalDataManagerTest,
GetCreditCardSuggestions_ShowBankNameOfServerCards) {
- // Turn on feature flag.
- base::test::ScopedFeatureList scoped_feature_list_;
- scoped_feature_list_.InitAndEnableFeature(kAutofillCreditCardBankNameDisplay);
-
EnableWalletCardImport();
// Add a local card.
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index 3eb470e..b3d06c2f 100644
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -405,26 +405,6 @@
]
}
],
- "AutofillCreditCardBankNameDisplay": [
- {
- "platforms": [
- "android",
- "chromeos",
- "ios",
- "linux",
- "mac",
- "win"
- ],
- "experiments": [
- {
- "name": "BankName_Experiment",
- "enable_features": [
- "AutofillCreditCardBankNameDisplay"
- ]
- }
- ]
- }
- ],
"AutofillCreditCardSigninPromo": [
{
"platforms": [
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index bb8cbb5..8578dc7 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -25533,7 +25533,6 @@
<int value="-1847776781"
label="enable-loading-ipc-optimization-for-small-resources"/>
<int value="-1839874877" label="WebXROrientationSensorDevice:enabled"/>
- <int value="-1839637286" label="AutofillCreditCardBankNameDisplay:disabled"/>
<int value="-1839496458" label="disable-file-manager-touch-mode"/>
<int value="-1838482444" label="disable-settings-window"/>
<int value="-1837329460" label="NewEncodeCpuLoadEstimator:enabled"/>
@@ -25971,7 +25970,6 @@
<int value="-759830869" label="enable-tab-discarding"/>
<int value="-757946835"
label="OmniboxUIExperimentShowSuggestionFavicons:enabled"/>
- <int value="-751273871" label="AutofillCreditCardBankNameDisplay:enabled"/>
<int value="-750175757" label="ClientLoFi:enabled"/>
<int value="-749048160" label="enable-panels"/>
<int value="-747463111" label="ContentSuggestionsNotifications:disabled"/>