| 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_REQUEST_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 ui::ModalType GetModalType() const override; | 54 ui::ModalType GetModalType() const override; |
| 55 | 55 |
| 56 // views::DialogDelegate | 56 // views::DialogDelegate |
| 57 bool Cancel() override; | 57 bool Cancel() override; |
| 58 bool ShouldShowCloseButton() const override; | 58 bool ShouldShowCloseButton() const override; |
| 59 int GetDialogButtons() const override; | 59 int GetDialogButtons() const override; |
| 60 | 60 |
| 61 // payments::PaymentRequestDialog | 61 // payments::PaymentRequestDialog |
| 62 void ShowDialog() override; | 62 void ShowDialog() override; |
| 63 void CloseDialog() override; | 63 void CloseDialog() override; |
| 64 void UpdatePayButtonState(bool enabled) override; |
| 64 | 65 |
| 65 void GoBack(); | 66 void GoBack(); |
| 66 void ShowOrderSummary(); | 67 void ShowOrderSummary(); |
| 67 void ShowShippingListSheet(); | 68 void ShowShippingListSheet(); |
| 68 void ShowPaymentMethodSheet(); | 69 void ShowPaymentMethodSheet(); |
| 69 void ShowCreditCardEditor(); | 70 void ShowCreditCardEditor(); |
| 70 | 71 |
| 71 ViewStack* view_stack_for_testing() { return &view_stack_; } | 72 ViewStack* view_stack_for_testing() { return &view_stack_; } |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 void ShowInitialPaymentSheet(); | 75 void ShowInitialPaymentSheet(); |
| 75 | 76 |
| 76 // views::View | 77 // views::View |
| 77 gfx::Size GetPreferredSize() const override; | 78 gfx::Size GetPreferredSize() const override; |
| 78 void ViewHierarchyChanged( | 79 void ViewHierarchyChanged( |
| 79 const ViewHierarchyChangedDetails& details) override; | 80 const ViewHierarchyChangedDetails& details) override; |
| 80 | 81 |
| 81 // Non-owned reference to the PaymentRequest that initiated this dialog. Since | 82 // Non-owned reference to the PaymentRequest that initiated this dialog. Since |
| 82 // the PaymentRequest object always outlives this one, the pointer should | 83 // the PaymentRequest object always outlives this one, the pointer should |
| 83 // always be valid even though there is no direct ownership relationship | 84 // always be valid even though there is no direct ownership relationship |
| 84 // between the two. | 85 // between the two. |
| 85 PaymentRequest* request_; | 86 PaymentRequest* request_; |
| 86 ControllerMap controller_map_; | 87 ControllerMap controller_map_; |
| 87 ViewStack view_stack_; | 88 ViewStack view_stack_; |
| 88 | 89 |
| 90 // Used to lookup the payment sheet view controller. Weak reference that is |
| 91 // nullified when the view is removed from the hierarchy. |
| 92 views::View* payment_sheet_view_; |
| 93 |
| 89 // May be null. | 94 // May be null. |
| 90 ObserverForTest* observer_for_testing_; | 95 ObserverForTest* observer_for_testing_; |
| 91 | 96 |
| 92 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); | 97 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); |
| 93 }; | 98 }; |
| 94 | 99 |
| 95 } // namespace payments | 100 } // namespace payments |
| 96 | 101 |
| 97 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ | 102 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ |
| OLD | NEW |