Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp

Issue 2580893002: Gate web payments iframe support on runtime enabled feature. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/payments/PaymentRequest.h" 5 #include "modules/payments/PaymentRequest.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8StringResource.h" 10 #include "bindings/core/v8/V8StringResource.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 475
476 // 2. If |document|'s browsing context is a top-level browsing context, then 476 // 2. If |document|'s browsing context is a top-level browsing context, then
477 // return true. 477 // return true.
478 if (frame->isMainFrame()) 478 if (frame->isMainFrame())
479 return true; 479 return true;
480 480
481 // 3. If |document|'s browsing context has a browsing context container that 481 // 3. If |document|'s browsing context has a browsing context container that
482 // is an iframe element with an |allowpaymentrequest| attribute specified, and 482 // is an iframe element with an |allowpaymentrequest| attribute specified, and
483 // whose node document is allowed to use the feature indicated by 483 // whose node document is allowed to use the feature indicated by
484 // |allowpaymentrequest|, then return true. 484 // |allowpaymentrequest|, then return true.
485 if (frame->owner() && frame->owner()->allowPaymentRequest()) 485 if (RuntimeEnabledFeatures::paymentRequestIFrameEnabled() && frame->owner() &&
486 frame->owner()->allowPaymentRequest()) {
486 return allowedToUsePaymentRequest(frame->tree().parent()); 487 return allowedToUsePaymentRequest(frame->tree().parent());
488 }
487 489
488 // 4. Return false. 490 // 4. Return false.
489 return false; 491 return false;
490 } 492 }
491 493
492 } // namespace 494 } // namespace
493 495
494 PaymentRequest* PaymentRequest::create( 496 PaymentRequest* PaymentRequest::create(
495 Document& document, 497 Document& document,
496 const HeapVector<PaymentMethodData>& methodData, 498 const HeapVector<PaymentMethodData>& methodData,
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 m_completeResolver.clear(); 914 m_completeResolver.clear();
913 m_showResolver.clear(); 915 m_showResolver.clear();
914 m_abortResolver.clear(); 916 m_abortResolver.clear();
915 m_canMakePaymentResolver.clear(); 917 m_canMakePaymentResolver.clear();
916 if (m_clientBinding.is_bound()) 918 if (m_clientBinding.is_bound())
917 m_clientBinding.Close(); 919 m_clientBinding.Close();
918 m_paymentProvider.reset(); 920 m_paymentProvider.reset();
919 } 921 }
920 922
921 } // namespace blink 923 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698