| 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_ORDER_SUMMARY_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" | 9 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" |
| 10 #include "components/payments/content/payment_request.h" | |
| 11 #include "components/payments/content/payment_request_state.h" | 10 #include "components/payments/content/payment_request_state.h" |
| 12 | 11 |
| 13 namespace payments { | 12 namespace payments { |
| 14 | 13 |
| 15 class PaymentRequest; | 14 class PaymentRequestSpec; |
| 15 class PaymentRequestState; |
| 16 class PaymentRequestDialogView; | 16 class PaymentRequestDialogView; |
| 17 | 17 |
| 18 // The PaymentRequestSheetController subtype for the Order Summary screen of the | 18 // The PaymentRequestSheetController subtype for the Order Summary screen of the |
| 19 // Payment Request flow. | 19 // Payment Request flow. |
| 20 class OrderSummaryViewController : public PaymentRequestSheetController, | 20 class OrderSummaryViewController : public PaymentRequestSheetController, |
| 21 public PaymentRequestState::Observer { | 21 public PaymentRequestState::Observer { |
| 22 public: | 22 public: |
| 23 // Does not take ownership of the arguments, which should outlive this object. | 23 // Does not take ownership of the arguments, which should outlive this object. |
| 24 OrderSummaryViewController(PaymentRequest* request, | 24 OrderSummaryViewController(PaymentRequestSpec* spec, |
| 25 PaymentRequestState* state, |
| 25 PaymentRequestDialogView* dialog); | 26 PaymentRequestDialogView* dialog); |
| 26 ~OrderSummaryViewController() override; | 27 ~OrderSummaryViewController() override; |
| 27 | 28 |
| 28 // PaymentRequestSheetController: | 29 // PaymentRequestSheetController: |
| 29 std::unique_ptr<views::View> CreateView() override; | 30 std::unique_ptr<views::View> CreateView() override; |
| 30 std::unique_ptr<views::Button> CreatePrimaryButton() override; | 31 std::unique_ptr<views::Button> CreatePrimaryButton() override; |
| 31 | 32 |
| 32 // PaymentRequestState::Observer: | 33 // PaymentRequestState::Observer: |
| 33 void OnSelectedInformationChanged() override; | 34 void OnSelectedInformationChanged() override; |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 void UpdatePayButtonState(bool enabled); | 37 void UpdatePayButtonState(bool enabled); |
| 37 | 38 |
| 38 views::Button* pay_button_; | 39 views::Button* pay_button_; |
| 39 | 40 |
| 40 DISALLOW_COPY_AND_ASSIGN(OrderSummaryViewController); | 41 DISALLOW_COPY_AND_ASSIGN(OrderSummaryViewController); |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 } // namespace payments | 44 } // namespace payments |
| 44 | 45 |
| 45 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ | 46 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ |
| OLD | NEW |