| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 152 ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 153 ~ContactInfoValidationDelegate() {} | 153 ~ContactInfoValidationDelegate() {} |
| 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, bool was_blurred) { |
| 162 if (!was_blurred) |
| 163 return true; |
| 164 |
| 162 base::string16 error_message; | 165 base::string16 error_message; |
| 163 bool is_valid = ValidateTextfield(textfield, &error_message); | 166 bool is_valid = ValidateTextfield(textfield, &error_message); |
| 164 controller_->DisplayErrorMessageForField(field_.type, error_message); | 167 controller_->DisplayErrorMessageForField(field_.type, error_message); |
| 165 return is_valid; | 168 return is_valid; |
| 166 } | 169 } |
| 167 | 170 |
| 168 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 171 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 169 ValidateTextfield(views::Textfield* textfield, | 172 ValidateTextfield(views::Textfield* textfield, |
| 170 base::string16* error_message) { | 173 base::string16* error_message) { |
| 171 bool is_valid = true; | 174 bool is_valid = true; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 230 } |
| 228 | 231 |
| 229 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 232 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 230 ComboboxValueChanged(views::Combobox* combobox) { | 233 ComboboxValueChanged(views::Combobox* combobox) { |
| 231 // This UI doesn't contain any comboboxes. | 234 // This UI doesn't contain any comboboxes. |
| 232 NOTREACHED(); | 235 NOTREACHED(); |
| 233 return true; | 236 return true; |
| 234 } | 237 } |
| 235 | 238 |
| 236 } // namespace payments | 239 } // namespace payments |
| OLD | NEW |