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

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

Issue 2590953002: [Merge M-56] Gate web payments iframe support on runtime enabled feature. (Closed)
Patch Set: Created 3 years, 12 months 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 // 2. If |document|'s browsing context is a top-level browsing context, then 518 // 2. If |document|'s browsing context is a top-level browsing context, then
519 // return true. 519 // return true.
520 if (frame->isMainFrame()) 520 if (frame->isMainFrame())
521 return true; 521 return true;
522 522
523 // 3. If |document|'s browsing context has a browsing context container that 523 // 3. If |document|'s browsing context has a browsing context container that
524 // is an iframe element with an |allowpaymentrequest| attribute specified, and 524 // is an iframe element with an |allowpaymentrequest| attribute specified, and
525 // whose node document is allowed to use the feature indicated by 525 // whose node document is allowed to use the feature indicated by
526 // |allowpaymentrequest|, then return true. 526 // |allowpaymentrequest|, then return true.
527 if (frame->owner() && frame->owner()->allowPaymentRequest()) 527 if (RuntimeEnabledFeatures::paymentRequestIFrameEnabled() && frame->owner() &&
528 frame->owner()->allowPaymentRequest()) {
528 return allowedToUsePaymentRequest(frame->tree().parent()); 529 return allowedToUsePaymentRequest(frame->tree().parent());
530 }
529 531
530 // 4. Return false. 532 // 4. Return false.
531 return false; 533 return false;
532 } 534 }
533 535
534 } // namespace 536 } // namespace
535 537
536 PaymentRequest* PaymentRequest::create( 538 PaymentRequest* PaymentRequest::create(
537 ScriptState* scriptState, 539 ScriptState* scriptState,
538 const HeapVector<PaymentMethodData>& methodData, 540 const HeapVector<PaymentMethodData>& methodData,
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 m_completeResolver.clear(); 964 m_completeResolver.clear();
963 m_showResolver.clear(); 965 m_showResolver.clear();
964 m_abortResolver.clear(); 966 m_abortResolver.clear();
965 m_canMakePaymentResolver.clear(); 967 m_canMakePaymentResolver.clear();
966 if (m_clientBinding.is_bound()) 968 if (m_clientBinding.is_bound())
967 m_clientBinding.Close(); 969 m_clientBinding.Close();
968 m_paymentProvider.reset(); 970 m_paymentProvider.reset();
969 } 971 }
970 972
971 } // namespace blink 973 } // 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