| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // Payment Request dialog. | 21 // Payment Request dialog. |
| 22 class PaymentSheetViewController : public PaymentRequestSheetController, | 22 class PaymentSheetViewController : public PaymentRequestSheetController, |
| 23 public PaymentRequestState::Observer { | 23 public PaymentRequestState::Observer { |
| 24 public: | 24 public: |
| 25 // Does not take ownership of the arguments, which should outlive this object. | 25 // Does not take ownership of the arguments, which should outlive this object. |
| 26 PaymentSheetViewController(PaymentRequestSpec* spec, | 26 PaymentSheetViewController(PaymentRequestSpec* spec, |
| 27 PaymentRequestState* state, | 27 PaymentRequestState* state, |
| 28 PaymentRequestDialogView* dialog); | 28 PaymentRequestDialogView* dialog); |
| 29 ~PaymentSheetViewController() override; | 29 ~PaymentSheetViewController() override; |
| 30 | 30 |
| 31 // PaymentRequestSheetController: | |
| 32 std::unique_ptr<views::View> CreateView() override; | |
| 33 | |
| 34 // PaymentRequestState::Observer: | 31 // PaymentRequestState::Observer: |
| 35 void OnSelectedInformationChanged() override; | 32 void OnSelectedInformationChanged() override; |
| 36 | 33 |
| 37 private: | 34 private: |
| 38 // PaymentRequestSheetController: | 35 // PaymentRequestSheetController: |
| 39 std::unique_ptr<views::Button> CreatePrimaryButton() override; | 36 std::unique_ptr<views::Button> CreatePrimaryButton() override; |
| 37 bool ShouldShowHeaderBackArrow() override; |
| 38 base::string16 GetSheetTitle() override; |
| 39 void FillContentView(views::View* content_view) override; |
| 40 std::unique_ptr<views::View> CreateExtraFooterView() override; | 40 std::unique_ptr<views::View> CreateExtraFooterView() override; |
| 41 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 41 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 42 | 42 |
| 43 void UpdatePayButtonState(bool enabled); | 43 void UpdatePayButtonState(bool enabled); |
| 44 void UpdateContentView(); | |
| 45 | 44 |
| 46 std::unique_ptr<views::View> CreateShippingSectionContent(); | 45 std::unique_ptr<views::View> CreateShippingSectionContent(); |
| 47 std::unique_ptr<views::Button> CreateShippingRow(); | 46 std::unique_ptr<views::Button> CreateShippingRow(); |
| 48 std::unique_ptr<views::Button> CreatePaymentSheetSummaryRow(); | 47 std::unique_ptr<views::Button> CreatePaymentSheetSummaryRow(); |
| 49 std::unique_ptr<views::Button> CreatePaymentMethodRow(); | 48 std::unique_ptr<views::Button> CreatePaymentMethodRow(); |
| 50 std::unique_ptr<views::View> CreateContactInfoSectionContent(); | 49 std::unique_ptr<views::View> CreateContactInfoSectionContent(); |
| 51 std::unique_ptr<views::Button> CreateContactInfoRow(); | 50 std::unique_ptr<views::Button> CreateContactInfoRow(); |
| 52 std::unique_ptr<views::Button> CreateShippingOptionRow(); | 51 std::unique_ptr<views::Button> CreateShippingOptionRow(); |
| 53 | 52 |
| 54 std::unique_ptr<views::View> container_view_; | |
| 55 views::Button* pay_button_; | 53 views::Button* pay_button_; |
| 56 | 54 |
| 57 const int widest_name_column_view_width_; | 55 const int widest_name_column_view_width_; |
| 58 | 56 |
| 59 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewController); | 57 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewController); |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 } // namespace payments | 60 } // namespace payments |
| 63 | 61 |
| 64 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ | 62 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ |
| OLD | NEW |