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

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

Issue 2528503002: [WebPayments] Implement state transitions in desktop WebPayments dialog. (Closed)
Patch Set: Change ToggleInteractable to SetInteractable Created 4 years, 1 month 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/ui/payment_request_dialog.h
diff --git a/chrome/browser/payments/ui/payment_request_dialog.h b/chrome/browser/payments/ui/payment_request_dialog.h
index 6834c11bccaa5a141047be02d6f5259ce2331388..a3f508c270677d750a18d02a48d2a71bfd0b0f54 100644
--- a/chrome/browser/payments/ui/payment_request_dialog.h
+++ b/chrome/browser/payments/ui/payment_request_dialog.h
@@ -5,18 +5,27 @@
#ifndef CHROME_BROWSER_PAYMENTS_UI_PAYMENT_REQUEST_DIALOG_H_
#define CHROME_BROWSER_PAYMENTS_UI_PAYMENT_REQUEST_DIALOG_H_
+#include "chrome/browser/payments/ui/order_summary_state.h"
+#include "chrome/browser/payments/ui/payment_dialog_state.h"
+#include "chrome/browser/payments/ui/payment_sheet_state.h"
#include "components/payments/payment_request.mojom.h"
+#include "ui/views/animation/bounds_animator.h"
#include "ui/views/controls/label.h"
#include "ui/views/window/dialog_delegate.h"
namespace payments {
-class PaymentRequestDialog : public views::DialogDelegateView {
+class PaymentRequestDialog : public views::DialogDelegateView,
+ public PaymentSheetState::Observer,
+ public OrderSummaryState::Observer {
public:
explicit PaymentRequestDialog(
payments::mojom::PaymentRequestClientPtr client);
~PaymentRequestDialog() override;
+ void PushState(std::unique_ptr<PaymentDialogState> state);
+ void PopState();
+
// views::WidgetDelegate
ui::ModalType GetModalType() const override;
@@ -26,9 +35,18 @@ class PaymentRequestDialog : public views::DialogDelegateView {
// views::DialogDelegate
bool Cancel() override;
+ // PaymentSheetState::Observer:
+ void OnOrderSummaryClicked() override;
+
+ // OrderSummaryState::Observer:
+ void OnBackClicked() override;
+
private:
payments::mojom::PaymentRequestClientPtr client_;
- std::unique_ptr<views::Label> label_;
+ std::unique_ptr<views::BoundsAnimator> slide_in_animator_;
+ std::unique_ptr<views::BoundsAnimator> slide_out_animator_;
+
+ std::stack<std::unique_ptr<PaymentDialogState> > state_stack_;
DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialog);
};

Powered by Google App Engine
This is Rietveld 408576698