Chromium Code Reviews| 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 #include "components/payments/content/payment_request.h" | 5 #include "components/payments/content/payment_request.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 OnConnectionTerminated(); | 118 OnConnectionTerminated(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void PaymentRequest::OnPaymentResponseAvailable( | 121 void PaymentRequest::OnPaymentResponseAvailable( |
| 122 mojom::PaymentResponsePtr response) { | 122 mojom::PaymentResponsePtr response) { |
| 123 client_->OnPaymentResponse(std::move(response)); | 123 client_->OnPaymentResponse(std::move(response)); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void PaymentRequest::OnShippingOptionIdSelected( | 126 void PaymentRequest::OnShippingOptionIdSelected( |
| 127 std::string shipping_option_id) { | 127 std::string shipping_option_id) { |
| 128 spec_->StartWaitingForUpdateWith( | |
|
Mathieu
2017/04/13 15:35:29
What do you think about putting this in PaymentReq
anthonyvd
2017/04/13 21:05:59
Yeah makes sense. It was here because of the timer
| |
| 129 PaymentRequestSpec::UpdateReason::SHIPPING_OPTION); | |
| 128 client_->OnShippingOptionChange(shipping_option_id); | 130 client_->OnShippingOptionChange(shipping_option_id); |
| 129 } | 131 } |
| 130 | 132 |
| 131 void PaymentRequest::OnShippingAddressSelected( | 133 void PaymentRequest::OnShippingAddressSelected( |
| 132 mojom::PaymentAddressPtr address) { | 134 mojom::PaymentAddressPtr address) { |
| 135 spec_->StartWaitingForUpdateWith( | |
|
Mathieu
2017/04/13 15:35:29
Similarly in PaymentRequestState::SetSelectedShipp
anthonyvd
2017/04/13 21:05:59
Done.
| |
| 136 PaymentRequestSpec::UpdateReason::SHIPPING_ADDRESS); | |
| 133 client_->OnShippingAddressChange(std::move(address)); | 137 client_->OnShippingAddressChange(std::move(address)); |
| 134 } | 138 } |
| 135 | 139 |
| 136 void PaymentRequest::UserCancelled() { | 140 void PaymentRequest::UserCancelled() { |
| 137 // If |client_| is not bound, then the object is already being destroyed as | 141 // If |client_| is not bound, then the object is already being destroyed as |
| 138 // a result of a renderer event. | 142 // a result of a renderer event. |
| 139 if (!client_.is_bound()) | 143 if (!client_.is_bound()) |
| 140 return; | 144 return; |
| 141 | 145 |
| 142 // This sends an error to the renderer, which informs the API user. | 146 // This sends an error to the renderer, which informs the API user. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 158 binding_.Close(); | 162 binding_.Close(); |
| 159 delegate_->CloseDialog(); | 163 delegate_->CloseDialog(); |
| 160 manager_->DestroyRequest(this); | 164 manager_->DestroyRequest(this); |
| 161 } | 165 } |
| 162 | 166 |
| 163 void PaymentRequest::Pay() { | 167 void PaymentRequest::Pay() { |
| 164 state_->GeneratePaymentResponse(); | 168 state_->GeneratePaymentResponse(); |
| 165 } | 169 } |
| 166 | 170 |
| 167 } // namespace payments | 171 } // namespace payments |
| OLD | NEW |