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

Unified Diff: chrome/browser/payments/chrome_payment_request_delegate.cc

Issue 2649683002: [Payments] Improve the closing of the PR dialog. (Closed)
Patch Set: addressed comments from sky Created 3 years, 11 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/browser/payments/chrome_payment_request_delegate.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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*
« no previous file with comments | « chrome/browser/payments/chrome_payment_request_delegate.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698