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_EDITOR_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <tuple> | 9 #include <tuple> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 using ErrorLabelMap = | 86 using ErrorLabelMap = |
87 std::map<const EditorField, views::Label*, EditorField::Compare>; | 87 std::map<const EditorField, views::Label*, EditorField::Compare>; |
88 | 88 |
89 // Does not take ownership of the arguments, which should outlive this object. | 89 // Does not take ownership of the arguments, which should outlive this object. |
90 EditorViewController(PaymentRequest* request, | 90 EditorViewController(PaymentRequest* request, |
91 PaymentRequestDialogView* dialog); | 91 PaymentRequestDialogView* dialog); |
92 ~EditorViewController() override; | 92 ~EditorViewController() override; |
93 | 93 |
94 // PaymentRequestSheetController: | 94 // PaymentRequestSheetController: |
95 std::unique_ptr<views::View> CreateView() override; | 95 std::unique_ptr<views::View> CreateView() override; |
96 std::unique_ptr<views::View> CreateLeadingFooterView() override; | 96 std::unique_ptr<views::View> CreateExtraView() override; |
Mathieu
2017/02/23 16:22:03
optional nit: CreateExtraFooterView? It would be m
anthonyvd
2017/02/23 16:27:34
Great suggestion, done.
| |
97 | 97 |
98 virtual std::unique_ptr<views::View> CreateHeaderView() = 0; | 98 virtual std::unique_ptr<views::View> CreateHeaderView() = 0; |
99 // Returns the field definitions used to build the UI. | 99 // Returns the field definitions used to build the UI. |
100 virtual std::vector<EditorField> GetFieldDefinitions() = 0; | 100 virtual std::vector<EditorField> GetFieldDefinitions() = 0; |
101 // Validates the data entered and attempts to save; returns true on success. | 101 // Validates the data entered and attempts to save; returns true on success. |
102 virtual bool ValidateModelAndSave() = 0; | 102 virtual bool ValidateModelAndSave() = 0; |
103 // Creates a ValidationDelegate which knows how to validate for a given | 103 // Creates a ValidationDelegate which knows how to validate for a given |
104 // |field| definition. | 104 // |field| definition. |
105 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate( | 105 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate( |
106 const EditorField& field) = 0; | 106 const EditorField& field) = 0; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 ComboboxMap comboboxes_; | 148 ComboboxMap comboboxes_; |
149 // Tracks the relationship between a field and its error label. | 149 // Tracks the relationship between a field and its error label. |
150 ErrorLabelMap error_labels_; | 150 ErrorLabelMap error_labels_; |
151 | 151 |
152 DISALLOW_COPY_AND_ASSIGN(EditorViewController); | 152 DISALLOW_COPY_AND_ASSIGN(EditorViewController); |
153 }; | 153 }; |
154 | 154 |
155 } // namespace payments | 155 } // namespace payments |
156 | 156 |
157 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ | 157 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ |
OLD | NEW |