| 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" |
| 11 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" | 11 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" |
| 12 | 12 |
| 13 namespace payments { | 13 namespace payments { |
| 14 | 14 |
| 15 class PaymentRequest; | 15 class PaymentRequest; |
| 16 class PaymentRequestDialogView; | 16 class PaymentRequestDialogView; |
| 17 | 17 |
| 18 // The PaymentRequestSheetController subtype for the Payment Sheet screen of the | 18 // The PaymentRequestSheetController subtype for the Payment Sheet screen of the |
| 19 // Payment Request dialog. | 19 // Payment Request dialog. |
| 20 class PaymentSheetViewController : public PaymentRequestSheetController { | 20 class PaymentSheetViewController : public PaymentRequestSheetController { |
| 21 public: | 21 public: |
| 22 // Does not take ownership of the arguments, which should outlive this object. | 22 // Does not take ownership of the arguments, which should outlive this object. |
| 23 PaymentSheetViewController(PaymentRequest* request, | 23 PaymentSheetViewController(PaymentRequest* request, |
| 24 PaymentRequestDialogView* dialog); | 24 PaymentRequestDialogView* dialog); |
| 25 ~PaymentSheetViewController() override; | 25 ~PaymentSheetViewController() override; |
| 26 | 26 |
| 27 // PaymentRequestSheetController: | 27 // PaymentRequestSheetController: |
| 28 std::unique_ptr<views::View> CreateView() override; | 28 std::unique_ptr<views::View> CreateView() override; |
| 29 std::unique_ptr<views::Button> CreatePrimaryButton() override; |
| 30 |
| 31 void UpdatePayButtonState(bool enabled); |
| 29 | 32 |
| 30 private: | 33 private: |
| 31 // PaymentRequestSheetController: | 34 // PaymentRequestSheetController: |
| 32 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 35 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 33 | 36 |
| 34 std::unique_ptr<views::View> CreateOrderSummarySectionContent(); | 37 std::unique_ptr<views::View> CreateOrderSummarySectionContent(); |
| 35 std::unique_ptr<views::View> CreateShippingSectionContent(); | 38 std::unique_ptr<views::View> CreateShippingSectionContent(); |
| 36 std::unique_ptr<views::Button> CreateShippingRow(); | 39 std::unique_ptr<views::Button> CreateShippingRow(); |
| 37 std::unique_ptr<views::Button> CreatePaymentSheetSummaryRow(); | 40 std::unique_ptr<views::Button> CreatePaymentSheetSummaryRow(); |
| 38 std::unique_ptr<views::Button> CreatePaymentMethodRow(); | 41 std::unique_ptr<views::Button> CreatePaymentMethodRow(); |
| 39 std::unique_ptr<views::View> CreateContactInfoSectionContent(); | 42 std::unique_ptr<views::View> CreateContactInfoSectionContent(); |
| 40 std::unique_ptr<views::Button> CreateContactInfoRow(); | 43 std::unique_ptr<views::Button> CreateContactInfoRow(); |
| 41 | 44 |
| 45 views::Button* pay_button_; |
| 46 |
| 42 const int widest_name_column_view_width_; | 47 const int widest_name_column_view_width_; |
| 43 | 48 |
| 44 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewController); | 49 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewController); |
| 45 }; | 50 }; |
| 46 | 51 |
| 47 } // namespace payments | 52 } // namespace payments |
| 48 | 53 |
| 49 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ | 54 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ |
| OLD | NEW |