Commit fe250241 authored by Rouslan Solomakhin's avatar Rouslan Solomakhin Committed by Commit Bot

[Web Payment] App store billing feature flag.

Before this patch, Chrome on Android supported invoking its own TWA for
an app store billing payment method, without an ability to turn this
feature off.

This patch adds an "AppStoreBilling" feature flag that is enabled by
default on Android and checks this feature flag before looking up
payment support in the TWA. The feature flag is disabled on other
platforms where app store billing is not implemented yet.

After this patch, it's possible to turn off the feature of Chrome
invoking its own TWA for an app store billing payment method.

Bug: 1110494
Change-Id: I3c50acdb2949debcbf0d3162a14cb9a3fbeed673
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2329991Reviewed-by: default avatarNick Burris <nburris@chromium.org>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793661}
parent a54dd9c1
......@@ -308,7 +308,9 @@ public class AndroidPaymentAppFinder implements ManifestVerifyCallback {
ChromeActivity.fromWebContents(mFactoryDelegate.getParams().getWebContents());
if (!PaymentOptionsUtils.requestAnyInformation(
mFactoryDelegate.getParams().getPaymentOptions())
&& activity != null) {
&& activity != null
&& PaymentFeatureList.isEnabled(
PaymentFeatureList.WEB_PAYMENTS_APP_STORE_BILLING)) {
findAppStoreBillingApp(activity, allInstalledPaymentApps);
}
......
......@@ -28,6 +28,7 @@ public class PaymentFeatureList {
public static final String WEB_PAYMENTS = "WebPayments";
public static final String WEB_PAYMENTS_ALWAYS_ALLOW_JUST_IN_TIME_PAYMENT_APP =
"AlwaysAllowJustInTimePaymentApp";
public static final String WEB_PAYMENTS_APP_STORE_BILLING = "AppStoreBilling";
public static final String WEB_PAYMENTS_APP_STORE_BILLING_DEBUG = "AppStoreBillingDebug";
public static final String WEB_PAYMENTS_EXPERIMENTAL_FEATURES =
"WebPaymentsExperimentalFeatures";
......
......@@ -24,6 +24,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&::features::kWebPayments,
&::features::kWebPaymentsMinimalUI,
&features::kAlwaysAllowJustInTimePaymentApp,
&features::kAppStoreBilling,
&features::kAppStoreBillingDebug,
&features::kEnforceFullDelegation,
&features::kPaymentRequestSkipToGPay,
......
......@@ -4,6 +4,8 @@
#include "components/payments/core/features.h"
#include "build/build_config.h"
namespace payments {
namespace features {
......@@ -44,6 +46,15 @@ const base::Feature kWebPaymentsPerMethodCanMakePaymentQuota{
const base::Feature kWebPaymentsRedactShippingAddress{
"WebPaymentsRedactShippingAddress", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kAppStoreBilling {
"AppStoreBilling",
#if defined(OS_ANDROID)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif // OS_ANDROID
};
const base::Feature kAppStoreBillingDebug{"AppStoreBillingDebug",
base::FEATURE_DISABLED_BY_DEFAULT};
......
......@@ -35,6 +35,10 @@ extern const base::Feature kWebPaymentsModifiers;
// with a single URL based payment app and no other info requested.
extern const base::Feature kWebPaymentsSingleAppUiSkip;
// Used to control whether the invoking TWA can handle payments for app store
// payment method identifiers.
extern const base::Feature kAppStoreBilling;
// Used to control whether to remove the restriction that TWA has to be
// installed from specific app stores.
extern const base::Feature kAppStoreBillingDebug;
......
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