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