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 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "chrome/browser/ui/views/payments/view_stack.h" | 12 #include "chrome/browser/ui/views/payments/view_stack.h" |
13 #include "components/payments/content/payment_request_dialog.h" | 13 #include "components/payments/content/payment_request_dialog.h" |
14 #include "components/payments/content/payment_request_spec.h" | 14 #include "components/payments/content/payment_request_spec.h" |
15 #include "ui/views/controls/throbber.h" | 15 #include "ui/views/controls/throbber.h" |
16 #include "ui/views/window/dialog_delegate.h" | 16 #include "ui/views/window/dialog_delegate.h" |
17 | 17 |
| 18 namespace autofill { |
| 19 class AutofillProfile; |
| 20 class CreditCard; |
| 21 } // namespace autofill |
| 22 |
18 namespace payments { | 23 namespace payments { |
19 | 24 |
20 class PaymentRequest; | 25 class PaymentRequest; |
21 class PaymentRequestSheetController; | 26 class PaymentRequestSheetController; |
22 | 27 |
23 // Maps views owned by PaymentRequestDialogView::view_stack_ to their | 28 // Maps views owned by PaymentRequestDialogView::view_stack_ to their |
24 // controller. PaymentRequestDialogView is responsible for listening for those | 29 // controller. PaymentRequestDialogView is responsible for listening for those |
25 // views being removed from the hierarchy and delete the associated controllers. | 30 // views being removed from the hierarchy and delete the associated controllers. |
26 using ControllerMap = | 31 using ControllerMap = |
27 std::map<views::View*, std::unique_ptr<PaymentRequestSheetController>>; | 32 std::map<views::View*, std::unique_ptr<PaymentRequestSheetController>>; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void OnInvalidSpecProvided() override {} | 91 void OnInvalidSpecProvided() override {} |
87 void OnSpecUpdated() override; | 92 void OnSpecUpdated() override; |
88 | 93 |
89 void Pay(); | 94 void Pay(); |
90 void GoBack(); | 95 void GoBack(); |
91 void ShowContactProfileSheet(); | 96 void ShowContactProfileSheet(); |
92 void ShowOrderSummary(); | 97 void ShowOrderSummary(); |
93 void ShowShippingProfileSheet(); | 98 void ShowShippingProfileSheet(); |
94 void ShowPaymentMethodSheet(); | 99 void ShowPaymentMethodSheet(); |
95 void ShowShippingOptionSheet(); | 100 void ShowShippingOptionSheet(); |
96 void ShowCreditCardEditor(); | 101 // |credit_card| is the card to be edited, or nullptr for adding a card. |
97 void ShowShippingAddressEditor(); | 102 void ShowCreditCardEditor(autofill::CreditCard* credit_card = nullptr); |
| 103 // |profile| is the address to be edited, or nullptr for adding an address. |
| 104 void ShowShippingAddressEditor(autofill::AutofillProfile* profile = nullptr); |
98 void EditorViewUpdated(); | 105 void EditorViewUpdated(); |
99 | 106 |
100 void ShowCvcUnmaskPrompt( | 107 void ShowCvcUnmaskPrompt( |
101 const autofill::CreditCard& credit_card, | 108 const autofill::CreditCard& credit_card, |
102 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> | 109 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
103 result_delegate, | 110 result_delegate, |
104 content::WebContents* web_contents) override; | 111 content::WebContents* web_contents) override; |
105 | 112 |
106 // Shows a full dialog spinner with the "processing" label that doesn't offer | 113 // Shows a full dialog spinner with the "processing" label that doesn't offer |
107 // a way of closing the dialog. | 114 // a way of closing the dialog. |
(...skipping 29 matching lines...) Expand all Loading... |
137 // Used when the dialog is being closed to avoid re-entrancy into the | 144 // Used when the dialog is being closed to avoid re-entrancy into the |
138 // controller_map_. | 145 // controller_map_. |
139 bool being_closed_; | 146 bool being_closed_; |
140 | 147 |
141 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); | 148 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); |
142 }; | 149 }; |
143 | 150 |
144 } // namespace payments | 151 } // namespace payments |
145 | 152 |
146 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ | 153 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ |
OLD | NEW |