Chromium Code Reviews| 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..b983df6b7753ceb983a736d1379c8f31cd298778 100644 |
| --- a/chrome/browser/ui/views/payments/payment_request_dialog.h |
| +++ b/chrome/browser/ui/views/payments/payment_request_dialog.h |
| @@ -5,7 +5,9 @@ |
| #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 "chrome/browser/ui/views/payments/order_summary_state.h" |
| +#include "chrome/browser/ui/views/payments/payment_sheet_state.h" |
| +#include "ui/views/animation/bounds_animator.h" |
| #include "ui/views/window/dialog_delegate.h" |
| namespace payments { |
| @@ -15,27 +17,41 @@ 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 PaymentSheetState::Observer, |
| + public OrderSummaryState::Observer { |
| public: |
| explicit PaymentRequestDialog(PaymentRequestImpl* impl); |
| ~PaymentRequestDialog() override; |
| - // views::WidgetDelegate: |
| + void PushState(std::unique_ptr<PaymentDialogState> state); |
| + void PopState(); |
| + |
| + // views::WidgetDelegate |
| ui::ModalType GetModalType() const override; |
| - // views::View: |
| + // views::View |
| gfx::Size GetPreferredSize() const override; |
| - // views::DialogDelegate: |
| + // views::DialogDelegate |
| bool Cancel() override; |
| + // PaymentSheetState::Observer: |
| + void OnOrderSummaryClicked() override; |
| + |
| + // OrderSummaryState::Observer: |
| + void OnBackClicked() override; |
| + |
| private: |
| // 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<views::BoundsAnimator> slide_in_animator_; |
| + std::unique_ptr<views::BoundsAnimator> slide_out_animator_; |
| + |
| + std::stack<std::unique_ptr<PaymentDialogState> > state_stack_; |
|
sky
2016/12/08 03:58:17
You shouldn't need the space between '>' and '>'.
anthonyvd
2016/12/08 20:31:22
Done.
|
| DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialog); |
| }; |