Chromium Code Reviews| Index: chrome/browser/ui/views/payments/payment_request_sheet_controller.h |
| diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h b/chrome/browser/ui/views/payments/payment_request_sheet_controller.h |
| index 655c91d21aa7432a387273901fd5454e77c72c8f..336310bf796b5e3fced92f5822bb6f9560e62e35 100644 |
| --- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h |
| +++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.h |
| @@ -31,9 +31,9 @@ class PaymentRequestSheetController : public views::ButtonListener { |
| PaymentRequestSheetController(PaymentRequestSpec* spec, |
| PaymentRequestState* state, |
| PaymentRequestDialogView* dialog); |
| - ~PaymentRequestSheetController() override {} |
| + ~PaymentRequestSheetController() override; |
| - virtual std::unique_ptr<views::View> CreateView() = 0; |
| + std::unique_ptr<views::View> CreateView(); |
| PaymentRequestSpec* spec() { return spec_; } |
| PaymentRequestState* state() { return state_; } |
| @@ -43,6 +43,8 @@ class PaymentRequestSheetController : public views::ButtonListener { |
| PaymentRequestDialogView* dialog() { return dialog_; } |
| protected: |
| + void UpdateContentView(); |
|
Mathieu
2017/03/23 11:36:45
let's add a comment, here and below
anthonyvd
2017/03/23 16:18:11
Done.
|
| + |
| // Creates and returns the primary action button for this sheet. It's |
| // typically a blue button with the "Pay" or "Done" labels. Subclasses may |
| // return an empty std::unique_ptr (nullptr) to indicate that no primary |
| @@ -52,6 +54,11 @@ class PaymentRequestSheetController : public views::ButtonListener { |
| // enabled state). |
| virtual std::unique_ptr<views::Button> CreatePrimaryButton(); |
| + virtual bool ShouldShowHeaderBackArrow(); |
| + virtual base::string16 GetSheetTitle() = 0; |
| + |
| + virtual void FillContentView(views::View* content_view) = 0; |
| + |
| // Creates and returns the view to be displayed next to the "Pay" and "Cancel" |
| // buttons. May return an empty std::unique_ptr (nullptr) to indicate that no |
| // extra view is to be displayed.The caller takes ownership of the view but |
| @@ -67,6 +74,11 @@ class PaymentRequestSheetController : public views::ButtonListener { |
| // views::ButtonListener: |
| void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| + // Creates the row of button containing the Pay, cancel, and extra buttons. |
| + // |controller| is installed as the listener for button events. |
| + std::unique_ptr<views::View> CreateFooterView(); |
| + |
| + private: |
| // Creates a view to be displayed in the PaymentRequestDialog. |
| // |header_view| is the view displayed on top of the dialog, containing title, |
| // (optional) back button, and close buttons. |
| @@ -82,19 +94,13 @@ class PaymentRequestSheetController : public views::ButtonListener { |
| // +---------------------------+ |
| // | EXTRA VIEW | PAY | CANCEL | <-- footer |
| // +---------------------------+ |
| - std::unique_ptr<views::View> CreatePaymentView( |
| - std::unique_ptr<views::View> header_view, |
| - std::unique_ptr<views::View> content_view); |
| - |
| - // Creates the row of button containing the Pay, cancel, and extra buttons. |
| - // |controller| is installed as the listener for button events. |
| - std::unique_ptr<views::View> CreateFooterView(); |
| + std::unique_ptr<views::View> CreatePaymentView(); |
| - private: |
| // All these are not owned. Will outlive this. |
| PaymentRequestSpec* spec_; |
| PaymentRequestState* state_; |
| PaymentRequestDialogView* dialog_; |
| + std::unique_ptr<views::View> content_view_; |
| DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController); |
| }; |