| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 base::UTF16ToUTF8(text), | 170 base::UTF16ToUTF8(text), |
| 171 autofill::AutofillCountry::CountryCodeForLocale(locale_))); | 171 autofill::AutofillCountry::CountryCodeForLocale(locale_))); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 174 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 175 IsValidTextfield(views::Textfield* textfield) { | 175 IsValidTextfield(views::Textfield* textfield) { |
| 176 return ValidateTextfield(textfield, nullptr); | 176 return ValidateTextfield(textfield, nullptr); |
| 177 } | 177 } |
| 178 | 178 |
| 179 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 179 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 180 TextfieldValueChanged(views::Textfield* textfield) { | 180 TextfieldValueChanged(views::Textfield* textfield, bool was_blurred) { |
| 181 if (!was_blurred) |
| 182 return true; |
| 183 |
| 181 base::string16 error_message; | 184 base::string16 error_message; |
| 182 bool is_valid = ValidateTextfield(textfield, &error_message); | 185 bool is_valid = ValidateTextfield(textfield, &error_message); |
| 183 controller_->DisplayErrorMessageForField(field_.type, error_message); | 186 controller_->DisplayErrorMessageForField(field_.type, error_message); |
| 184 return is_valid; | 187 return is_valid; |
| 185 } | 188 } |
| 186 | 189 |
| 187 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 190 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 188 ValidateTextfield(views::Textfield* textfield, | 191 ValidateTextfield(views::Textfield* textfield, |
| 189 base::string16* error_message) { | 192 base::string16* error_message) { |
| 190 bool is_valid = true; | 193 bool is_valid = true; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 249 } |
| 247 | 250 |
| 248 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 251 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 249 ComboboxValueChanged(views::Combobox* combobox) { | 252 ComboboxValueChanged(views::Combobox* combobox) { |
| 250 // This UI doesn't contain any comboboxes. | 253 // This UI doesn't contain any comboboxes. |
| 251 NOTREACHED(); | 254 NOTREACHED(); |
| 252 return true; | 255 return true; |
| 253 } | 256 } |
| 254 | 257 |
| 255 } // namespace payments | 258 } // namespace payments |
| OLD | NEW |