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

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

Issue 2528503002: [WebPayments] Implement state transitions in desktop WebPayments dialog. (Closed)
Patch Set: Change the ViewStack interface to take std::unique_ptr<views::View> directly. 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.h
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog.h b/chrome/browser/ui/views/payments/payment_request_dialog.h
index 6a08d698dc21b5e6ab5c551978a5fc29ac9c1b22..2b1100dbe2c772bf290cbccde06a4b0c44fb8ba4 100644
--- a/chrome/browser/ui/views/payments/payment_request_dialog.h
+++ b/chrome/browser/ui/views/payments/payment_request_dialog.h
@@ -5,9 +5,11 @@
#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_H_
#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_H_
-#include "ui/views/controls/label.h"
+#include "ui/views/controls/button/button.h"
#include "ui/views/window/dialog_delegate.h"
+class ViewStack;
+
namespace payments {
class PaymentRequestImpl;
@@ -15,27 +17,34 @@ class PaymentRequestImpl;
// The dialog delegate that represents a desktop WebPayments dialog. This class
// is responsible for displaying the view associated with the current state of
// the WebPayments flow and managing the transition between those states.
-class PaymentRequestDialog : public views::DialogDelegateView {
+class PaymentRequestDialog : public views::DialogDelegateView,
+ public views::ButtonListener {
public:
explicit PaymentRequestDialog(PaymentRequestImpl* impl);
~PaymentRequestDialog() override;
- // views::WidgetDelegate:
+ // views::WidgetDelegate
ui::ModalType GetModalType() const override;
- // views::View:
+ // views::View
gfx::Size GetPreferredSize() const override;
- // views::DialogDelegate:
+ // views::DialogDelegate
bool Cancel() override;
private:
+ // views::ButtonListener:
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+
+ void ShowOrderSummary();
+ void GoBack();
+
// Non-owned reference to the PaymentRequestImpl that initiated this dialog.
// Since the PaymentRequestImpl object always outlives this one, the pointer
// should always be valid even though there is no direct ownership
// relationship between the two.
PaymentRequestImpl* impl_;
- std::unique_ptr<views::Label> label_;
+ std::unique_ptr<ViewStack> view_stack_;
DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialog);
};

Powered by Google App Engine
This is Rietveld 408576698