Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 | 25 |
| 26 class PaymentRequest; | 26 class PaymentRequest; |
| 27 class PaymentRequestSheetController; | 27 class PaymentRequestSheetController; |
| 28 | 28 |
| 29 // Maps views owned by PaymentRequestDialogView::view_stack_ to their | 29 // Maps views owned by PaymentRequestDialogView::view_stack_ to their |
| 30 // controller. PaymentRequestDialogView is responsible for listening for those | 30 // controller. PaymentRequestDialogView is responsible for listening for those |
| 31 // views being removed from the hierarchy and delete the associated controllers. | 31 // views being removed from the hierarchy and delete the associated controllers. |
| 32 using ControllerMap = | 32 using ControllerMap = |
| 33 std::map<views::View*, std::unique_ptr<PaymentRequestSheetController>>; | 33 std::map<views::View*, std::unique_ptr<PaymentRequestSheetController>>; |
| 34 | 34 |
| 35 enum class BackNavigationType { | |
| 36 kOneStep = 0, | |
| 37 kPaymentSheet, | |
| 38 }; | |
| 39 | |
| 35 // The dialog delegate that represents a desktop WebPayments dialog. This class | 40 // The dialog delegate that represents a desktop WebPayments dialog. This class |
| 36 // is responsible for displaying the view associated with the current state of | 41 // is responsible for displaying the view associated with the current state of |
| 37 // the WebPayments flow and managing the transition between those states. | 42 // the WebPayments flow and managing the transition between those states. |
| 38 class PaymentRequestDialogView : public views::DialogDelegateView, | 43 class PaymentRequestDialogView : public views::DialogDelegateView, |
| 39 public PaymentRequestDialog, | 44 public PaymentRequestDialog, |
| 40 public PaymentRequestSpec::Observer { | 45 public PaymentRequestSpec::Observer { |
| 41 public: | 46 public: |
| 42 class ObserverForTest { | 47 class ObserverForTest { |
| 43 public: | 48 public: |
| 44 virtual void OnDialogOpened() = 0; | 49 virtual void OnDialogOpened() = 0; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 void GoBackToPaymentSheet(); | 106 void GoBackToPaymentSheet(); |
| 102 void ShowContactProfileSheet(); | 107 void ShowContactProfileSheet(); |
| 103 void ShowOrderSummary(); | 108 void ShowOrderSummary(); |
| 104 void ShowShippingProfileSheet(); | 109 void ShowShippingProfileSheet(); |
| 105 void ShowPaymentMethodSheet(); | 110 void ShowPaymentMethodSheet(); |
| 106 void ShowShippingOptionSheet(); | 111 void ShowShippingOptionSheet(); |
| 107 // |credit_card| is the card to be edited, or nullptr for adding a card. | 112 // |credit_card| is the card to be edited, or nullptr for adding a card. |
| 108 // |on_edited| is called when |credit_card| was successfully edited, and | 113 // |on_edited| is called when |credit_card| was successfully edited, and |
| 109 // |on_added| is called when a new credit card was added (the reference is | 114 // |on_added| is called when a new credit card was added (the reference is |
| 110 // short-lived; callee should make a copy of the CreditCard object). | 115 // short-lived; callee should make a copy of the CreditCard object). |
| 116 // |back_navigation_type| identifies the type of navigation to execute once | |
| 117 // the editor has completed successfully. | |
| 111 void ShowCreditCardEditor( | 118 void ShowCreditCardEditor( |
| 119 BackNavigationType back_navigation_type, | |
| 120 int next_ui_tag, | |
|
Mathieu
2017/05/04 20:29:19
can you document this one
MAD
2017/05/05 00:50:07
Done.
| |
| 112 base::OnceClosure on_edited, | 121 base::OnceClosure on_edited, |
| 113 base::OnceCallback<void(const autofill::CreditCard&)> on_added, | 122 base::OnceCallback<void(const autofill::CreditCard&)> on_added, |
| 114 autofill::CreditCard* credit_card = nullptr); | 123 autofill::CreditCard* credit_card = nullptr); |
| 115 // |profile| is the address to be edited, or nullptr for adding an address. | 124 // |profile| is the address to be edited, or nullptr for adding an address. |
| 116 // |on_edited| is called when |profile| was successfully edited, and | 125 // |on_edited| is called when |profile| was successfully edited, and |
| 117 // |on_added| is called when a new profile was added (the reference is | 126 // |on_added| is called when a new profile was added (the reference is |
| 118 // short-lived; callee should make a copy of the profile object). | 127 // short-lived; callee should make a copy of the profile object). |
| 128 // |back_navigation_type| identifies the type of navigation to execute once | |
| 129 // the editor has completed successfully. | |
| 119 void ShowShippingAddressEditor( | 130 void ShowShippingAddressEditor( |
| 131 BackNavigationType back_navigation_type, | |
| 120 base::OnceClosure on_edited, | 132 base::OnceClosure on_edited, |
| 121 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, | 133 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, |
| 122 autofill::AutofillProfile* profile); | 134 autofill::AutofillProfile* profile); |
| 123 // |profile| is the profile to be edited, or nullptr for adding a profile. | 135 // |profile| is the profile to be edited, or nullptr for adding a profile. |
| 124 void ShowContactInfoEditor(autofill::AutofillProfile* profile = nullptr); | 136 // |back_navigation_type| identifies the type of navigation to execute once |
| 137 // the editor has completed successfully. | |
| 138 void ShowContactInfoEditor(BackNavigationType back_navigation_type, | |
| 139 autofill::AutofillProfile* profile = nullptr); | |
| 125 void EditorViewUpdated(); | 140 void EditorViewUpdated(); |
| 126 | 141 |
| 127 void ShowCvcUnmaskPrompt( | 142 void ShowCvcUnmaskPrompt( |
| 128 const autofill::CreditCard& credit_card, | 143 const autofill::CreditCard& credit_card, |
| 129 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> | 144 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
| 130 result_delegate, | 145 result_delegate, |
| 131 content::WebContents* web_contents) override; | 146 content::WebContents* web_contents) override; |
| 132 | 147 |
| 133 // Shows a full dialog spinner with the "processing" label that doesn't offer | 148 // Shows a full dialog spinner with the "processing" label that doesn't offer |
| 134 // a way of closing the dialog. | 149 // a way of closing the dialog. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 164 // Used when the dialog is being closed to avoid re-entrancy into the | 179 // Used when the dialog is being closed to avoid re-entrancy into the |
| 165 // controller_map_. | 180 // controller_map_. |
| 166 bool being_closed_; | 181 bool being_closed_; |
| 167 | 182 |
| 168 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); | 183 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); |
| 169 }; | 184 }; |
| 170 | 185 |
| 171 } // namespace payments | 186 } // namespace payments |
| 172 | 187 |
| 173 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ | 188 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ |
| OLD | NEW |