OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 // Does not take ownership of the arguments (except for the |on_edited| and | 30 // Does not take ownership of the arguments (except for the |on_edited| and |
31 // |on_added| callbacks), which should outlive this object. Additionally, | 31 // |on_added| callbacks), which should outlive this object. Additionally, |
32 // |profile| could be nullptr if we are adding a new shipping address. Else, | 32 // |profile| could be nullptr if we are adding a new shipping address. Else, |
33 // it's a valid pointer to a card that needs to be updated, and which will | 33 // it's a valid pointer to a card that needs to be updated, and which will |
34 // outlive this controller. | 34 // outlive this controller. |
35 ShippingAddressEditorViewController( | 35 ShippingAddressEditorViewController( |
36 PaymentRequestSpec* spec, | 36 PaymentRequestSpec* spec, |
37 PaymentRequestState* state, | 37 PaymentRequestState* state, |
38 PaymentRequestDialogView* dialog, | 38 PaymentRequestDialogView* dialog, |
| 39 BackNavigationType back_navigation_type, |
39 base::OnceClosure on_edited, | 40 base::OnceClosure on_edited, |
40 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, | 41 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, |
41 autofill::AutofillProfile* profile); | 42 autofill::AutofillProfile* profile); |
42 ~ShippingAddressEditorViewController() override; | 43 ~ShippingAddressEditorViewController() override; |
43 | 44 |
44 // EditorViewController: | 45 // EditorViewController: |
45 std::unique_ptr<views::View> CreateHeaderView() override; | 46 std::unique_ptr<views::View> CreateHeaderView() override; |
| 47 std::unique_ptr<views::View> CreateCustomFieldsView() override; |
46 std::vector<EditorField> GetFieldDefinitions() override; | 48 std::vector<EditorField> GetFieldDefinitions() override; |
47 base::string16 GetInitialValueForType( | 49 base::string16 GetInitialValueForType( |
48 autofill::ServerFieldType type) override; | 50 autofill::ServerFieldType type) override; |
49 bool ValidateModelAndSave() override; | 51 bool ValidateModelAndSave() override; |
50 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( | 52 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( |
51 const EditorField& field) override; | 53 const EditorField& field) override; |
52 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( | 54 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( |
53 const autofill::ServerFieldType& type) override; | 55 const autofill::ServerFieldType& type) override; |
54 void OnPerformAction(views::Combobox* combobox) override; | 56 void OnPerformAction(views::Combobox* combobox) override; |
55 void UpdateEditorView() override; | 57 void UpdateEditorView() override; |
56 | 58 |
57 // PaymentRequestSheetController: | 59 // PaymentRequestSheetController: |
58 base::string16 GetSheetTitle() override; | 60 base::string16 GetSheetTitle() override; |
| 61 std::unique_ptr<views::Button> CreatePrimaryButton() override; |
59 | 62 |
60 private: | 63 private: |
61 class ShippingAddressValidationDelegate : public ValidationDelegate { | 64 class ShippingAddressValidationDelegate : public ValidationDelegate { |
62 public: | 65 public: |
63 ShippingAddressValidationDelegate( | 66 ShippingAddressValidationDelegate( |
64 ShippingAddressEditorViewController* parent, | 67 ShippingAddressEditorViewController* parent, |
65 const EditorField& field); | 68 const EditorField& field); |
66 ~ShippingAddressValidationDelegate() override; | 69 ~ShippingAddressValidationDelegate() override; |
67 | 70 |
68 // ValidationDelegate: | 71 // ValidationDelegate: |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 132 |
130 // Failed to fetch the region data in time. | 133 // Failed to fetch the region data in time. |
131 void RegionDataLoadTimedOut(); | 134 void RegionDataLoadTimedOut(); |
132 | 135 |
133 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController); | 136 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController); |
134 }; | 137 }; |
135 | 138 |
136 } // namespace payments | 139 } // namespace payments |
137 | 140 |
138 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL
LER_H_ | 141 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL
LER_H_ |
OLD | NEW |