Commit 42733f4a authored by Jared Saul's avatar Jared Saul Committed by Commit Bot

Convert IsFlagEnabled() functions to just check the flags

We've moved away from having separate IsXYZFlagEnabled() functions in
favor of just having the flag-checking code at the calling points
themselves. I believe these are the last three stragglers.

Change-Id: I8060cacd962851dc22691ef95437b7aa72b6fbd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1639051Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Jared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#665647}
parent 48ddc2de
......@@ -208,8 +208,8 @@ std::unique_ptr<views::View> SaveCardOfferBubbleViews::CreateMainContentView() {
// Prepare the prefilled cardholder name.
base::string16 prefilled_name;
if (!features::
IsAutofillUpstreamBlankCardholderNameFieldExperimentEnabled()) {
if (!base::FeatureList::IsEnabled(
features::kAutofillUpstreamBlankCardholderNameField)) {
prefilled_name =
base::UTF8ToUTF16(controller()->GetAccountInfo().full_name);
}
......
......@@ -753,9 +753,10 @@ int CreditCardSaveManager::GetDetectedValues() const {
if ((!(detected_values & DetectedValue::CARDHOLDER_NAME) &&
!(detected_values & DetectedValue::ADDRESS_NAME) &&
!(detected_values & DetectedValue::HAS_GOOGLE_PAYMENTS_ACCOUNT) &&
features::IsAutofillUpstreamEditableCardholderNameExperimentEnabled()) ||
features::
IsAutofillUpstreamAlwaysRequestCardholderNameExperimentEnabled()) {
base::FeatureList::IsEnabled(
features::kAutofillUpstreamEditableCardholderName)) ||
base::FeatureList::IsEnabled(
features::kAutofillUpstreamAlwaysRequestCardholderName)) {
detected_values |= DetectedValue::USER_PROVIDED_NAME;
}
......
......@@ -131,10 +131,19 @@ const base::Feature kAutofillUpstream{"AutofillUpstream",
const base::Feature kAutofillUpstreamAllowAllEmailDomains{
"AutofillUpstreamAllowAllEmailDomains", base::FEATURE_DISABLED_BY_DEFAULT};
// For testing purposes; not to be launched. When enabled, Chrome Upstream
// always requests that the user enters/confirms cardholder name in the
// offer-to-save dialog, regardless of if it was present or if the user is a
// Google Payments customer. Note that this will override the detected
// cardholder name, if one was found.
const base::Feature kAutofillUpstreamAlwaysRequestCardholderName{
"AutofillUpstreamAlwaysRequestCardholderName",
base::FEATURE_DISABLED_BY_DEFAULT};
// For experimental purposes; not to be made available in chrome://flags. When
// enabled and Chrome Upstream requests the cardholder name in the offer-to-save
// dialog, the field will be blank instead of being prefilled with the name from
// the user's Google Account.
const base::Feature kAutofillUpstreamBlankCardholderNameField{
"AutofillUpstreamBlankCardholderNameField",
base::FEATURE_DISABLED_BY_DEFAULT};
......@@ -147,6 +156,9 @@ const base::Feature kAutofillUpstreamDisallowElo{
const base::Feature kAutofillUpstreamDisallowJcb{
"AutofillUpstreamDisallowJcb", base::FEATURE_DISABLED_BY_DEFAULT};
// If enabled, Chrome Upstream can request the user to enter/confirm cardholder
// name in the offer-to-save bubble if it was not detected or was conflicting
// during the checkout flow and the user is NOT a Google Payments customer.
const base::Feature kAutofillUpstreamEditableCardholderName{
"AutofillUpstreamEditableCardholderName",
#if defined(OS_ANDROID)
......@@ -165,19 +177,5 @@ const base::Feature kAutofillUpstreamEditableExpirationDate{
const base::Feature kAutofillUsePaymentsCustomerData{
"AutofillUsePaymentsCustomerData", base::FEATURE_ENABLED_BY_DEFAULT};
bool IsAutofillUpstreamAlwaysRequestCardholderNameExperimentEnabled() {
return base::FeatureList::IsEnabled(
features::kAutofillUpstreamAlwaysRequestCardholderName);
}
bool IsAutofillUpstreamBlankCardholderNameFieldExperimentEnabled() {
return base::FeatureList::IsEnabled(
features::kAutofillUpstreamBlankCardholderNameField);
}
bool IsAutofillUpstreamEditableCardholderNameExperimentEnabled() {
return base::FeatureList::IsEnabled(kAutofillUpstreamEditableCardholderName);
}
} // namespace features
} // namespace autofill
......@@ -55,25 +55,6 @@ extern const char
extern const char
kAutofillSaveCreditCardUsesImprovedMessagingParamValueConfirmAndSaveCard[];
// For testing purposes; not to be launched. When enabled, Chrome Upstream
// always requests that the user enters/confirms cardholder name in the
// offer-to-save dialog, regardless of if it was present or if the user is a
// Google Payments customer. Note that this will override the detected
// cardholder name, if one was found.
bool IsAutofillUpstreamAlwaysRequestCardholderNameExperimentEnabled();
// For experimental purposes; not to be made available in chrome://flags. When
// enabled and Chrome Upstream requests the cardholder name in the offer-to-save
// dialog, the field will be blank instead of being prefilled with the name from
// the user's Google Account.
bool IsAutofillUpstreamBlankCardholderNameFieldExperimentEnabled();
// Returns whether the experiment is enabled where Chrome Upstream can request
// the user to enter/confirm cardholder name in the offer-to-save bubble if it
// was not detected or was conflicting during the checkout flow and the user is
// NOT a Google Payments customer.
bool IsAutofillUpstreamEditableCardholderNameExperimentEnabled();
} // namespace features
} // namespace autofill
......
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