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

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

Issue 2789093002: [Payments] Desktop: implement shipping address/option change (Closed)
Patch Set: compile fix 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
« no previous file with comments | « components/payments/content/payment_request.h ('k') | components/payments/content/payment_request_spec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0569efcc79278e2be094adddec8fcf9076507e9b 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(
+ 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.
« no previous file with comments | « components/payments/content/payment_request.h ('k') | components/payments/content/payment_request_spec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698