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_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // Used to validate |field| type. A reference to the |controller| should | 71 // Used to validate |field| type. A reference to the |controller| should |
72 // outlive this delegate, and a list of |supported_card_networks| can be | 72 // outlive this delegate, and a list of |supported_card_networks| can be |
73 // passed in to validate |field| (the data will be copied to the delegate). | 73 // passed in to validate |field| (the data will be copied to the delegate). |
74 CreditCardValidationDelegate( | 74 CreditCardValidationDelegate( |
75 const EditorField& field, | 75 const EditorField& field, |
76 EditorViewController* controller, | 76 EditorViewController* controller, |
77 const std::vector<std::string>& supported_card_networks); | 77 const std::vector<std::string>& supported_card_networks); |
78 ~CreditCardValidationDelegate() override; | 78 ~CreditCardValidationDelegate() override; |
79 | 79 |
80 // ValidationDelegate: | 80 // ValidationDelegate: |
81 bool ValidateTextfield(views::Textfield* textfield) override; | 81 bool IsValidTextfield(views::Textfield* textfield) override; |
82 bool ValidateCombobox(views::Combobox* combobox) override; | 82 bool IsValidCombobox(views::Combobox* combobox) override; |
| 83 bool TextfieldValueChanged(views::Textfield* textfield) override; |
| 84 bool ComboboxValueChanged(views::Combobox* combobox) override; |
83 void ComboboxModelChanged(views::Combobox* combobox) override {} | 85 void ComboboxModelChanged(views::Combobox* combobox) override {} |
84 | 86 |
85 private: | 87 private: |
86 // Validates a specific |value|. | 88 // Validates a specific |value|/|combobox|. |
87 bool ValidateValue(const base::string16& value); | 89 bool ValidateValue(const base::string16& value, |
| 90 base::string16* error_message); |
| 91 bool ValidateCombobox(views::Combobox* combobox, |
| 92 base::string16* error_message); |
88 | 93 |
89 EditorField field_; | 94 EditorField field_; |
90 // Outlives this class. | 95 // Outlives this class. |
91 EditorViewController* controller_; | 96 EditorViewController* controller_; |
92 // The list of supported basic card networks. | 97 // The list of supported basic card networks. |
93 std::set<std::string> supported_card_networks_; | 98 std::set<std::string> supported_card_networks_; |
94 | 99 |
95 DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate); | 100 DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate); |
96 }; | 101 }; |
97 | 102 |
(...skipping 16 matching lines...) Expand all Loading... |
114 | 119 |
115 // The value to use for the add billing address button tag. | 120 // The value to use for the add billing address button tag. |
116 int add_billing_address_button_tag_; | 121 int add_billing_address_button_tag_; |
117 | 122 |
118 DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController); | 123 DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController); |
119 }; | 124 }; |
120 | 125 |
121 } // namespace payments | 126 } // namespace payments |
122 | 127 |
123 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H
_ | 128 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H
_ |
OLD | NEW |