| 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 <unordered_map> | 9 #include <unordered_map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 using ComboboxMap = | 75 using ComboboxMap = |
| 76 std::unordered_map<ValidatingCombobox*, const EditorField>; | 76 std::unordered_map<ValidatingCombobox*, const EditorField>; |
| 77 | 77 |
| 78 // Does not take ownership of the arguments, which should outlive this object. | 78 // Does not take ownership of the arguments, which should outlive this object. |
| 79 EditorViewController(PaymentRequest* request, | 79 EditorViewController(PaymentRequest* request, |
| 80 PaymentRequestDialogView* dialog); | 80 PaymentRequestDialogView* dialog); |
| 81 ~EditorViewController() override; | 81 ~EditorViewController() override; |
| 82 | 82 |
| 83 // PaymentRequestSheetController: | 83 // PaymentRequestSheetController: |
| 84 std::unique_ptr<views::View> CreateView() override; | 84 std::unique_ptr<views::View> CreateView() override; |
| 85 std::unique_ptr<views::View> CreateLeadingFooterView() override; |
| 85 | 86 |
| 86 virtual std::unique_ptr<views::View> CreateHeaderView() = 0; | 87 virtual std::unique_ptr<views::View> CreateHeaderView() = 0; |
| 87 // Returns the field definitions used to build the UI. | 88 // Returns the field definitions used to build the UI. |
| 88 virtual std::vector<EditorField> GetFieldDefinitions() = 0; | 89 virtual std::vector<EditorField> GetFieldDefinitions() = 0; |
| 89 // Validates the data entered and attempts to save; returns true on success. | 90 // Validates the data entered and attempts to save; returns true on success. |
| 90 virtual bool ValidateModelAndSave() = 0; | 91 virtual bool ValidateModelAndSave() = 0; |
| 91 // Creates a ValidationDelegate which knows how to validate for a given | 92 // Creates a ValidationDelegate which knows how to validate for a given |
| 92 // |field| definition. | 93 // |field| definition. |
| 93 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate( | 94 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate( |
| 94 const EditorField& field) = 0; | 95 const EditorField& field) = 0; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 124 // long as the input field is visible. | 125 // long as the input field is visible. |
| 125 TextFieldsMap text_fields_; | 126 TextFieldsMap text_fields_; |
| 126 ComboboxMap comboboxes_; | 127 ComboboxMap comboboxes_; |
| 127 | 128 |
| 128 DISALLOW_COPY_AND_ASSIGN(EditorViewController); | 129 DISALLOW_COPY_AND_ASSIGN(EditorViewController); |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 } // namespace payments | 132 } // namespace payments |
| 132 | 133 |
| 133 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ | 134 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ |
| OLD | NEW |