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

Unified Diff: components/payments/content/payment_request.cc

Issue 2789093002: [Payments] Desktop: implement shipping address/option change (Closed)
Patch Set: fixed test Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/payments/content/payment_request.cc
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc
index aa9b1fb0dce703b91abeb398db3201e9e0ac8296..9da7549994680d162bcc4b55c9194b01e79253f7 100644
--- a/components/payments/content/payment_request.cc
+++ b/components/payments/content/payment_request.cc
@@ -71,6 +71,16 @@ void PaymentRequest::Show() {
delegate_->ShowDialog(this);
}
+void PaymentRequest::UpdateWith(mojom::PaymentDetailsPtr details) {
+ std::string error;
+ if (!payments::validatePaymentDetails(details, &error)) {
+ LOG(ERROR) << error;
+ OnConnectionTerminated();
+ return;
+ }
+ spec_->UpdateWith(std::move(details));
+}
+
void PaymentRequest::Abort() {
// The API user has decided to abort. We return a successful abort message to
// the renderer, which closes the Mojo message pipe, which triggers
@@ -112,6 +122,16 @@ void PaymentRequest::OnPaymentResponseAvailable(
client_->OnPaymentResponse(std::move(response));
}
+void PaymentRequest::OnShippingOptionIdSelected(
+ const std::string& shipping_option_id) {
+ client_->OnShippingOptionChange(shipping_option_id);
+}
+
+void PaymentRequest::OnShippingAddressSelected(
+ mojom::PaymentAddressPtr address) {
+ client_->OnShippingAddressChange(std::move(address));
+}
+
void PaymentRequest::UserCancelled() {
// If |client_| is not bound, then the object is already being destroyed as
// a result of a renderer event.

Powered by Google App Engine
This is Rietveld 408576698