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

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 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
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..3b0cd3087bbbfb8ed89d4dcf61b850bcae3e7de1 100644
--- a/chrome/browser/payments/chrome_payment_request_delegate.cc
+++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -7,17 +7,24 @@
#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) {
please use gerrit instead 2017/01/23 21:18:50 nit: Would it be a good idea to add "DCHECK_EQ(dia
Mathieu 2017/01/23 21:53:57 Done.
+ dialog_ = chrome::CreatePaymentRequestDialog(request);
+ dialog_->ShowDialog();
+}
+
+void ChromePaymentRequestDelegate::CloseDialog() {
+ if (dialog_) {
please use gerrit instead 2017/01/23 21:18:50 nit: no {}
Mathieu 2017/01/23 21:53:57 Done.
+ dialog_->CloseDialog();
+ }
please use gerrit instead 2017/01/23 21:18:50 nit: would it be a good idea to add "dialog_ = nul
Mathieu 2017/01/23 21:53:57 Yes that's not a bad idea. Gets you back into a be
}
autofill::PersonalDataManager*

Powered by Google App Engine
This is Rietveld 408576698