| Index: chrome/browser/payments/chrome_payment_request_delegate.cc
|
| diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc
|
| index 5a65cb149f25e3d81d52e2607c36cd3c6d0aee15..58a649228d8b1c3670e3299e3343c224d62e482e 100644
|
| --- a/chrome/browser/payments/chrome_payment_request_delegate.cc
|
| +++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
|
| @@ -4,20 +4,30 @@
|
|
|
| #include "chrome/browser/payments/chrome_payment_request_delegate.h"
|
|
|
| +#include "base/macros.h"
|
| #include "chrome/browser/autofill/personal_data_manager_factory.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/browser_dialogs.h"
|
| +#include "components/payments/payment_request_dialog.h"
|
| #include "content/public/browser/web_contents.h"
|
|
|
| namespace payments {
|
|
|
| ChromePaymentRequestDelegate::ChromePaymentRequestDelegate(
|
| content::WebContents* web_contents)
|
| - : web_contents_(web_contents) {}
|
| + : dialog_(nullptr), web_contents_(web_contents) {}
|
|
|
| -void ChromePaymentRequestDelegate::ShowPaymentRequestDialog(
|
| - PaymentRequest* request) {
|
| - chrome::ShowPaymentRequestDialog(request);
|
| +void ChromePaymentRequestDelegate::ShowDialog(PaymentRequest* request) {
|
| + DCHECK_EQ(nullptr, dialog_);
|
| + dialog_ = chrome::CreatePaymentRequestDialog(request);
|
| + dialog_->ShowDialog();
|
| +}
|
| +
|
| +void ChromePaymentRequestDelegate::CloseDialog() {
|
| + if (dialog_) {
|
| + dialog_->CloseDialog();
|
| + dialog_ = nullptr;
|
| + }
|
| }
|
|
|
| autofill::PersonalDataManager*
|
|
|