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

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

Issue 2855203002: [Payments] Display the shipping option error alongside the address (Closed)
Patch Set: added tests Created 3 years, 8 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_spec.cc
diff --git a/components/payments/content/payment_request_spec.cc b/components/payments/content/payment_request_spec.cc
index 5e58552f51e8866cd314d3ba6188a7bf8e2c64d1..1aca4d5eae3ad48ec4858622a283dff31cc6db14 100644
--- a/components/payments/content/payment_request_spec.cc
+++ b/components/payments/content/payment_request_spec.cc
@@ -166,6 +166,7 @@ void PaymentRequestSpec::UpdateSelectedShippingOption() {
if (!request_shipping())
return;
+ selected_shipping_option_error_.clear();
// As per the spec, the selected shipping option should initially be the last
// one in the array that has its selected field set to true.
auto selected_shipping_option_it = std::find_if(
@@ -177,7 +178,8 @@ void PaymentRequestSpec::UpdateSelectedShippingOption() {
selected_shipping_option_ = selected_shipping_option_it->get();
} else {
// It's possible that there is no selected shipping option.
- // TODO(crbug.com/710004): Show an error in this case.
+ if (!details().error.empty())
+ selected_shipping_option_error_ = details().error;
selected_shipping_option_ = nullptr;
}
}

Powered by Google App Engine
This is Rietveld 408576698