| 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 IsValidTextfield(views::Textfield* textfield) override; |
| 81 bool ValidateCombobox(views::Combobox* combobox) override; | 81 bool IsValidCombobox(views::Combobox* combobox) override; |
| 82 bool TextfieldValueChanged(views::Textfield* textfield) override; |
| 83 bool ComboboxValueChanged(views::Combobox* combobox) 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|/|combobox|. |
| 86 bool ValidateValue(const base::string16& value); | 88 bool ValidateValue(const base::string16& value, |
| 89 base::string16* error_message); |
| 90 bool ValidateCombobox(views::Combobox* combobox, |
| 91 base::string16* error_message); |
| 87 | 92 |
| 88 EditorField field_; | 93 EditorField field_; |
| 89 // Outlives this class. | 94 // Outlives this class. |
| 90 EditorViewController* controller_; | 95 EditorViewController* controller_; |
| 91 // The list of supported basic card networks. | 96 // The list of supported basic card networks. |
| 92 std::set<std::string> supported_card_networks_; | 97 std::set<std::string> supported_card_networks_; |
| 93 | 98 |
| 94 DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate); | 99 DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate); |
| 95 }; | 100 }; |
| 96 | 101 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 113 | 118 |
| 114 // The value to use for the add billing address button tag. | 119 // The value to use for the add billing address button tag. |
| 115 int add_billing_address_button_tag_; | 120 int add_billing_address_button_tag_; |
| 116 | 121 |
| 117 DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController); | 122 DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController); |
| 118 }; | 123 }; |
| 119 | 124 |
| 120 } // namespace payments | 125 } // namespace payments |
| 121 | 126 |
| 122 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H
_ | 127 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H
_ |
| OLD | NEW |