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

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

Issue 2439543002: Ignore shipping options if requestShipping=false (Closed)
Patch Set: Test owners file points to production code owners file Created 4 years, 2 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 | « chrome/test/data/android/payments/payment_request_extra_shipping_options_test.html ('k') | 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/JSONValuesForV8.h" 8 #include "bindings/core/v8/JSONValuesForV8.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 632
633 scriptState->domWindow()->frame()->interfaceProvider()->getInterface( 633 scriptState->domWindow()->frame()->interfaceProvider()->getInterface(
634 mojo::GetProxy(&m_paymentProvider)); 634 mojo::GetProxy(&m_paymentProvider));
635 m_paymentProvider.set_connection_error_handler(convertToBaseCallback( 635 m_paymentProvider.set_connection_error_handler(convertToBaseCallback(
636 WTF::bind(&PaymentRequest::OnError, wrapWeakPersistent(this), 636 WTF::bind(&PaymentRequest::OnError, wrapWeakPersistent(this),
637 mojom::blink::PaymentErrorReason::UNKNOWN))); 637 mojom::blink::PaymentErrorReason::UNKNOWN)));
638 m_paymentProvider->Init( 638 m_paymentProvider->Init(
639 m_clientBinding.CreateInterfacePtrAndBind(), 639 m_clientBinding.CreateInterfacePtrAndBind(),
640 mojo::WTFArray<mojom::blink::PaymentMethodDataPtr>::From( 640 mojo::WTFArray<mojom::blink::PaymentMethodDataPtr>::From(
641 validatedMethodData), 641 validatedMethodData),
642 maybeKeepShippingOptions(mojom::blink::PaymentDetails::From(details), 642 maybeKeepShippingOptions(
643 keepShippingOptions), 643 mojom::blink::PaymentDetails::From(details),
644 keepShippingOptions && m_options.requestShipping()),
644 mojom::blink::PaymentOptions::From(m_options)); 645 mojom::blink::PaymentOptions::From(m_options));
645 } 646 }
646 647
647 void PaymentRequest::contextDestroyed() { 648 void PaymentRequest::contextDestroyed() {
648 clearResolversAndCloseMojoConnection(); 649 clearResolversAndCloseMojoConnection();
649 } 650 }
650 651
651 void PaymentRequest::OnShippingAddressChange( 652 void PaymentRequest::OnShippingAddressChange(
652 mojom::blink::PaymentAddressPtr address) { 653 mojom::blink::PaymentAddressPtr address) {
653 DCHECK(m_showResolver); 654 DCHECK(m_showResolver);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 m_completeTimer.stop(); 812 m_completeTimer.stop();
812 m_completeResolver.clear(); 813 m_completeResolver.clear();
813 m_showResolver.clear(); 814 m_showResolver.clear();
814 m_abortResolver.clear(); 815 m_abortResolver.clear();
815 if (m_clientBinding.is_bound()) 816 if (m_clientBinding.is_bound())
816 m_clientBinding.Close(); 817 m_clientBinding.Close();
817 m_paymentProvider.reset(); 818 m_paymentProvider.reset();
818 } 819 }
819 820
820 } // namespace blink 821 } // namespace blink
OLDNEW
« no previous file with comments | « chrome/test/data/android/payments/payment_request_extra_shipping_options_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698