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 <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void DisplayErrorMessageForField(const EditorField& field, | 99 void DisplayErrorMessageForField(const EditorField& field, |
100 const base::string16& error_message); | 100 const base::string16& error_message); |
101 | 101 |
102 const ComboboxMap& comboboxes() const { return comboboxes_; } | 102 const ComboboxMap& comboboxes() const { return comboboxes_; } |
103 const TextFieldsMap& text_fields() const { return text_fields_; } | 103 const TextFieldsMap& text_fields() const { return text_fields_; } |
104 | 104 |
105 protected: | 105 protected: |
106 virtual std::unique_ptr<views::View> CreateHeaderView() = 0; | 106 virtual std::unique_ptr<views::View> CreateHeaderView() = 0; |
107 // Returns the field definitions used to build the UI. | 107 // Returns the field definitions used to build the UI. |
108 virtual std::vector<EditorField> GetFieldDefinitions() = 0; | 108 virtual std::vector<EditorField> GetFieldDefinitions() = 0; |
| 109 virtual base::string16 GetInitialValueForType( |
| 110 autofill::ServerFieldType type) = 0; |
109 // Validates the data entered and attempts to save; returns true on success. | 111 // Validates the data entered and attempts to save; returns true on success. |
110 virtual bool ValidateModelAndSave() = 0; | 112 virtual bool ValidateModelAndSave() = 0; |
111 // Creates a ValidationDelegate which knows how to validate for a given | 113 // Creates a ValidationDelegate which knows how to validate for a given |
112 // |field| definition. | 114 // |field| definition. |
113 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate( | 115 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate( |
114 const EditorField& field) = 0; | 116 const EditorField& field) = 0; |
115 virtual std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( | 117 virtual std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( |
116 const autofill::ServerFieldType& type) = 0; | 118 const autofill::ServerFieldType& type) = 0; |
117 | 119 |
118 // PaymentRequestSheetController; | 120 // PaymentRequestSheetController; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 ComboboxMap comboboxes_; | 157 ComboboxMap comboboxes_; |
156 // Tracks the relationship between a field and its error label. | 158 // Tracks the relationship between a field and its error label. |
157 ErrorLabelMap error_labels_; | 159 ErrorLabelMap error_labels_; |
158 | 160 |
159 DISALLOW_COPY_AND_ASSIGN(EditorViewController); | 161 DISALLOW_COPY_AND_ASSIGN(EditorViewController); |
160 }; | 162 }; |
161 | 163 |
162 } // namespace payments | 164 } // namespace payments |
163 | 165 |
164 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ | 166 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ |
OLD | NEW |