Chromium Code Reviews| Index: chrome/browser/payments/payment_request_impl.cc |
| diff --git a/chrome/browser/payments/payment_request_impl.cc b/chrome/browser/payments/payment_request_impl.cc |
| index 743ab19e26bf7dad196d9ced28889fdbc322523d..b5484f1472a5a0b242d440c087b03b5319c911b1 100644 |
| --- a/chrome/browser/payments/payment_request_impl.cc |
| +++ b/chrome/browser/payments/payment_request_impl.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/lazy_instance.h" |
| #include "chrome/browser/ui/browser_dialogs.h" |
| +#include "components/payments/payment_details_validation.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/web_contents.h" |
| @@ -62,10 +63,16 @@ void PaymentRequestImpl::Init( |
| payments::mojom::PaymentOptionsPtr options) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| client_ = std::move(client); |
| + std::string err_msg; |
| + if (!validatePaymentDetails(details, &err_msg)) { |
|
please use gerrit instead
2017/01/05 20:11:58
Also:
LOG(ERROR) << err_msg;
By the way, you may
|
| + client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL); |
| + client_.reset(); |
| + } |
| } |
| void PaymentRequestImpl::Show() { |
| - chrome::ShowPaymentRequestDialog(this); |
| + if (client_.is_bound() && binding_.is_bound()) |
| + chrome::ShowPaymentRequestDialog(this); |
| } |
|
please use gerrit instead
2017/01/05 20:11:58
Can you do this? it should ensure that PaymentRequ
|
| void PaymentRequestImpl::Cancel() { |