| OLD | NEW |
| 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 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ |
| 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ | 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 mojo::InterfaceRequest<mojom::PaymentRequest> request, | 48 mojo::InterfaceRequest<mojom::PaymentRequest> request, |
| 49 ObserverForTest* observer_for_testing); | 49 ObserverForTest* observer_for_testing); |
| 50 ~PaymentRequest() override; | 50 ~PaymentRequest() override; |
| 51 | 51 |
| 52 // mojom::PaymentRequest | 52 // mojom::PaymentRequest |
| 53 void Init(mojom::PaymentRequestClientPtr client, | 53 void Init(mojom::PaymentRequestClientPtr client, |
| 54 std::vector<mojom::PaymentMethodDataPtr> method_data, | 54 std::vector<mojom::PaymentMethodDataPtr> method_data, |
| 55 mojom::PaymentDetailsPtr details, | 55 mojom::PaymentDetailsPtr details, |
| 56 mojom::PaymentOptionsPtr options) override; | 56 mojom::PaymentOptionsPtr options) override; |
| 57 void Show() override; | 57 void Show() override; |
| 58 void UpdateWith(mojom::PaymentDetailsPtr details) override {} | 58 void UpdateWith(mojom::PaymentDetailsPtr details) override; |
| 59 void Abort() override; | 59 void Abort() override; |
| 60 void Complete(mojom::PaymentComplete result) override; | 60 void Complete(mojom::PaymentComplete result) override; |
| 61 void CanMakePayment() override; | 61 void CanMakePayment() override; |
| 62 | 62 |
| 63 // PaymentRequestSpec::Observer: | 63 // PaymentRequestSpec::Observer: |
| 64 void OnSpecUpdated() override {} |
| 64 void OnInvalidSpecProvided() override; | 65 void OnInvalidSpecProvided() override; |
| 65 | 66 |
| 66 // PaymentRequestState::Delegate: | 67 // PaymentRequestState::Delegate: |
| 67 void OnPaymentResponseAvailable(mojom::PaymentResponsePtr response) override; | 68 void OnPaymentResponseAvailable(mojom::PaymentResponsePtr response) override; |
| 69 void OnShippingOptionIdSelected(std::string shipping_option_id) override; |
| 70 void OnShippingAddressSelected(mojom::PaymentAddressPtr address) override; |
| 68 | 71 |
| 69 // Called when the user explicitely cancelled the flow. Will send a message | 72 // Called when the user explicitely cancelled the flow. Will send a message |
| 70 // to the renderer which will indirectly destroy this object (through | 73 // to the renderer which will indirectly destroy this object (through |
| 71 // OnConnectionTerminated). | 74 // OnConnectionTerminated). |
| 72 void UserCancelled(); | 75 void UserCancelled(); |
| 73 | 76 |
| 74 // As a result of a browser-side error or renderer-initiated mojo channel | 77 // As a result of a browser-side error or renderer-initiated mojo channel |
| 75 // closure (e.g. there was an error on the renderer side, or payment was | 78 // closure (e.g. there was an error on the renderer side, or payment was |
| 76 // successful), this method is called. It is responsible for cleaning up, | 79 // successful), this method is called. It is responsible for cleaning up, |
| 77 // such as possibly closing the dialog. | 80 // such as possibly closing the dialog. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 98 | 101 |
| 99 // May be null, must outlive this object. | 102 // May be null, must outlive this object. |
| 100 ObserverForTest* observer_for_testing_; | 103 ObserverForTest* observer_for_testing_; |
| 101 | 104 |
| 102 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); | 105 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); |
| 103 }; | 106 }; |
| 104 | 107 |
| 105 } // namespace payments | 108 } // namespace payments |
| 106 | 109 |
| 107 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ | 110 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ |
| OLD | NEW |