| 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" |
| 10 | 11 |
| 11 namespace payments { | 12 namespace payments { |
| 12 | 13 |
| 13 class PaymentRequest; | 14 class PaymentRequest; |
| 14 class PaymentRequestDialogView; | 15 class PaymentRequestDialogView; |
| 15 | 16 |
| 16 // The PaymentRequestSheetController subtype for the Order Summary screen of the | 17 // The PaymentRequestSheetController subtype for the Order Summary screen of the |
| 17 // Payment Request flow. | 18 // Payment Request flow. |
| 18 class OrderSummaryViewController : public PaymentRequestSheetController { | 19 class OrderSummaryViewController : public PaymentRequestSheetController, |
| 20 public PaymentRequest::Observer { |
| 19 public: | 21 public: |
| 20 // 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. |
| 21 OrderSummaryViewController(PaymentRequest* request, | 23 OrderSummaryViewController(PaymentRequest* request, |
| 22 PaymentRequestDialogView* dialog); | 24 PaymentRequestDialogView* dialog); |
| 23 ~OrderSummaryViewController() override; | 25 ~OrderSummaryViewController() override; |
| 24 | 26 |
| 25 // PaymentRequestSheetController: | 27 // PaymentRequestSheetController: |
| 26 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 // PaymentRequest::Observer: |
| 32 void OnSelectedInformationChanged() override; |
| 27 | 33 |
| 28 private: | 34 private: |
| 35 void UpdatePayButtonState(bool enabled); |
| 36 |
| 37 views::Button* pay_button_; |
| 38 |
| 29 DISALLOW_COPY_AND_ASSIGN(OrderSummaryViewController); | 39 DISALLOW_COPY_AND_ASSIGN(OrderSummaryViewController); |
| 30 }; | 40 }; |
| 31 | 41 |
| 32 } // namespace payments | 42 } // namespace payments |
| 33 | 43 |
| 34 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ | 44 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ |
| OLD | NEW |