Chromium Code Reviews| Index: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| index f67b63bede62e3795377d09323f5ff31669c1382..d9574b234199e19331c949713d7bcecaa0269e9c 100644 |
| --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| @@ -29,6 +29,7 @@ |
| #include "modules/payments/PaymentsValidators.h" |
| #include "mojo/public/cpp/bindings/interface_request.h" |
| #include "mojo/public/cpp/bindings/wtf_array.h" |
| +#include "platform/RuntimeEnabledFeatures.h" |
| #include "platform/mojo/MojoHelper.h" |
| #include "public/platform/InterfaceProvider.h" |
| #include "public/platform/Platform.h" |
| @@ -519,6 +520,9 @@ bool allowedToUsePaymentRequest(const Frame* frame) { |
| if (frame->isMainFrame()) |
| return true; |
| + if (!RuntimeEnabledFeatures::paymentRequestIFrameEnabled()) |
|
Rick Byers
2016/11/23 16:54:55
nit: this check is now redundant with the check in
please use gerrit instead
2016/11/23 17:27:36
Removed.
|
| + return false; |
| + |
| // 3. If |document|'s browsing context has a browsing context container that |
| // is an iframe element with an |allowpaymentrequest| attribute specified, and |
| // whose node document is allowed to use the feature indicated by |
| @@ -732,8 +736,10 @@ PaymentRequest::PaymentRequest(ScriptState* scriptState, |
| if (!allowedToUsePaymentRequest(scriptState->domWindow()->frame())) { |
| exceptionState.throwSecurityError( |
| - "Must be in a top-level browsing context or an iframe needs to specify " |
| - "'allowpaymentrequest' explicitly"); |
| + RuntimeEnabledFeatures::paymentRequestIFrameEnabled() |
| + ? "Must be in a top-level browsing context or an iframe needs to " |
| + "specify 'allowpaymentrequest' explicitly" |
| + : "Must be in a top-level browsing context"); |
| return; |
| } |