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

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

Issue 2768093006: [Payments] Desktop: Error message in the dialog. (Closed)
Patch Set: 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/payments/content/payment_request_delegate.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 ed48db057bf30588400e06c8a5f6d8b336445309..b34232b4ca25d89a6549aba13b7fb52ab85e1199 100644
--- a/components/payments/content/payment_request.cc
+++ b/components/payments/content/payment_request.cc
@@ -74,15 +74,17 @@ void PaymentRequest::Abort() {
client_->OnAbort(true /* aborted_successfully */);
}
-void PaymentRequest::Complete(payments::mojom::PaymentComplete result) {
+void PaymentRequest::Complete(mojom::PaymentComplete result) {
if (!client_.is_bound())
return;
- // TODO(mathp): Validate |result|.
-
- // When the renderer closes the connection,
- // PaymentRequest::OnConnectionTerminated will be called.
- client_->OnComplete();
+ if (result != mojom::PaymentComplete::SUCCESS) {
+ delegate_->ShowErrorMessage();
+ } else {
+ // When the renderer closes the connection,
+ // PaymentRequest::OnConnectionTerminated will be called.
+ client_->OnComplete();
+ }
}
void PaymentRequest::CanMakePayment() {
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/payments/content/payment_request_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698