[Payments] Rename isChanging() and noUpdatedPaymentDetails() methods.
This cl renames isChanging() to isWaitingForPaymentDetailsUpdate().
This function returns true after changePaymentMethod(),
changeShippingAddress(), and changeShippingOption() calls an before
updateWith() or NoUpdatedPaymentDetails() are called, showing that
change events are fired and we are waiting for merchants response.
This cl also renames noUpdatedPaymentDetials() method to
onPaymentDetailsNotUpdated() since the latter is more appropriate for
showing that the merchant has not updated any payment details in
response to change payment method, shipping address, or shipping
option events.
[email protected]
Bug: 984694
Change-Id: I9b9b5080c31b58432a42f611b880afa21fa79ec0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946597
Commit-Queue: Sahel Sharify <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Liquan (Max) Gu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#720675}
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc
index b0e3f18e..cd5bf05f 100644
--- a/components/payments/content/payment_request.cc
+++ b/components/payments/content/payment_request.cc
@@ -343,7 +343,7 @@
}
if (state()->selected_app() && state()->IsPaymentAppInvoked() &&
- payment_handler_host_.is_changing()) {
+ payment_handler_host_.is_waiting_for_payment_details_update()) {
payment_handler_host_.UpdateWith(
PaymentDetailsConverter::ConvertToPaymentRequestDetailsUpdate(
details, state()->selected_app()->HandlesShippingAddress(),
@@ -368,7 +368,7 @@
}
}
-void PaymentRequest::NoUpdatedPaymentDetails() {
+void PaymentRequest::OnPaymentDetailsNotUpdated() {
// This Mojo call is triggered by the user of the API doing nothing in
// response to a shipping address update event, so the error messages cannot
// be more verbose.
@@ -386,8 +386,9 @@
spec_->RecomputeSpecForDetails();
- if (state()->IsPaymentAppInvoked() && payment_handler_host_.is_changing()) {
- payment_handler_host_.NoUpdatedPaymentDetails();
+ if (state()->IsPaymentAppInvoked() &&
+ payment_handler_host_.is_waiting_for_payment_details_update()) {
+ payment_handler_host_.OnPaymentDetailsNotUpdated();
}
}