| 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 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" | 5 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/views/payments/validating_textfield.h" | 10 #include "chrome/browser/ui/views/payments/validating_textfield.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 155 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 156 IsValidTextfield(views::Textfield* textfield) { | 156 IsValidTextfield(views::Textfield* textfield) { |
| 157 return ValidateTextfield(textfield, nullptr); | 157 return ValidateTextfield(textfield, nullptr); |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 160 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 161 TextfieldValueChanged(views::Textfield* textfield) { | 161 TextfieldValueChanged(views::Textfield* textfield) { |
| 162 base::string16 error_message; | 162 base::string16 error_message; |
| 163 bool is_valid = ValidateTextfield(textfield, &error_message); | 163 bool is_valid = ValidateTextfield(textfield, &error_message); |
| 164 controller_->DisplayErrorMessageForField(field_, error_message); | 164 controller_->DisplayErrorMessageForField(field_.type, error_message); |
| 165 return is_valid; | 165 return is_valid; |
| 166 } | 166 } |
| 167 | 167 |
| 168 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 168 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 169 ValidateTextfield(views::Textfield* textfield, | 169 ValidateTextfield(views::Textfield* textfield, |
| 170 base::string16* error_message) { | 170 base::string16* error_message) { |
| 171 bool is_valid = true; | 171 bool is_valid = true; |
| 172 | 172 |
| 173 if (textfield->text().empty()) { | 173 if (textfield->text().empty()) { |
| 174 is_valid = false; | 174 is_valid = false; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 227 } |
| 228 | 228 |
| 229 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 229 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 230 ComboboxValueChanged(views::Combobox* combobox) { | 230 ComboboxValueChanged(views::Combobox* combobox) { |
| 231 // This UI doesn't contain any comboboxes. | 231 // This UI doesn't contain any comboboxes. |
| 232 NOTREACHED(); | 232 NOTREACHED(); |
| 233 return true; | 233 return true; |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace payments | 236 } // namespace payments |
| OLD | NEW |