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

Unified Diff: chrome/browser/ui/views/payments/payment_request_dialog.cc

Issue 2592833002: [WebPayments] Start populating the Payment Sheet. (Closed)
Patch Set: Created 4 years 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/ui/views/payments/payment_request_dialog.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog.cc b/chrome/browser/ui/views/payments/payment_request_dialog.cc
index 3f8daf32b5efc406805363a76e26f49b766fba6e..0856a5a1153f8b3d5716e5a68620e0baf674bb99 100644
--- a/chrome/browser/ui/views/payments/payment_request_dialog.cc
+++ b/chrome/browser/ui/views/payments/payment_request_dialog.cc
@@ -71,6 +71,23 @@ bool PaymentRequestDialog::Cancel() {
return true;
}
+bool PaymentRequestDialog::ShouldShowCloseButton() const {
+ // Don't show the normal close button on the dialog. This is because the
+ // typical dialog header doesn't allow displaying anything other that the
+ // title and the close button. This is insufficient for the PaymentRequest
+ // dialog, which must sometimes show the back arrow next to the title.
+ // Moreover, the title (and back arrow) should animate with the view they're
+ // attached to.
+ return false;
+}
+
+int PaymentRequestDialog::GetDialogButtons() const {
+ // The buttons should animate along with the different dialog sheets since
+ // each sheet presents a different set of buttons. Because of this, hide the
+ // usual dialog buttons.
+ return ui::DIALOG_BUTTON_NONE;
+}
+
void PaymentRequestDialog::GoBack() {
view_stack_.Pop();
}
@@ -82,6 +99,10 @@ void PaymentRequestDialog::ShowOrderSummary() {
true);
}
+void PaymentRequestDialog::CloseDialog() {
+ GetWidget()->Close();
+}
+
void PaymentRequestDialog::ShowInitialPaymentSheet() {
view_stack_.Push(
CreateViewAndInstallController<PaymentSheetViewController>(

Powered by Google App Engine
This is Rietveld 408576698