Commit 2370de33 authored by Jeevan Shikaram's avatar Jeevan Shikaram Committed by Commit Bot

[Play Billing] Ensure payments feature enabled on browser-side.

Check the feature the feature policy for payments.

Bug: 1137688
Change-Id: I38bd2a4db69270bf91f168310145962e1cf31f2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537212
Auto-Submit: Jeevan Shikaram <jshikaram@chromium.org>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827239}
parent 1480fbc8
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "chrome/browser/apps/digital_goods/util.h" #include "chrome/browser/apps/digital_goods/util.h"
#include "components/payments/core/features.h" #include "components/payments/core/features.h"
#include "components/payments/core/payments_experimental_features.h" #include "components/payments/core/payments_experimental_features.h"
#include "content/public/browser/render_frame_host.h"
#include "third_party/blink/public/mojom/feature_policy/feature_policy_feature.mojom-shared.h"
namespace { namespace {
...@@ -35,6 +37,12 @@ void DigitalGoodsFactoryImpl::BindDigitalGoodsFactory( ...@@ -35,6 +37,12 @@ void DigitalGoodsFactoryImpl::BindDigitalGoodsFactory(
void DigitalGoodsFactoryImpl::CreateDigitalGoods( void DigitalGoodsFactoryImpl::CreateDigitalGoods(
const std::string& payment_method, const std::string& payment_method,
CreateDigitalGoodsCallback callback) { CreateDigitalGoodsCallback callback) {
if (!render_frame_host_->IsFeatureEnabled(
blink::mojom::FeaturePolicyFeature::kPayment)) {
mojo::ReportBadMessage("Feature policy blocks Payment");
return;
}
// Check feature flag. // Check feature flag.
if (!payments::PaymentsExperimentalFeatures::IsEnabled( if (!payments::PaymentsExperimentalFeatures::IsEnabled(
payments::features::kAppStoreBilling)) { payments::features::kAppStoreBilling)) {
......
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