| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/browser/wallet/form_field_error.h" | 5 #include "components/autofill/content/browser/wallet/form_field_error.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 FormFieldError::FormFieldError(ErrorType error_type, Location location) | 53 FormFieldError::FormFieldError(ErrorType error_type, Location location) |
| 54 : error_type_(error_type), | 54 : error_type_(error_type), |
| 55 location_(location) {} | 55 location_(location) {} |
| 56 | 56 |
| 57 FormFieldError::~FormFieldError() {} | 57 FormFieldError::~FormFieldError() {} |
| 58 | 58 |
| 59 AutofillFieldType FormFieldError::GetAutofillType() const { | 59 ServerFieldType FormFieldError::GetAutofillType() const { |
| 60 switch (error_type_) { | 60 switch (error_type_) { |
| 61 case INVALID_PHONE_NUMBER: | 61 case INVALID_PHONE_NUMBER: |
| 62 if (location_ == LEGAL_ADDRESS || location_ == PAYMENT_INSTRUMENT) | 62 if (location_ == LEGAL_ADDRESS || location_ == PAYMENT_INSTRUMENT) |
| 63 return PHONE_BILLING_WHOLE_NUMBER; | 63 return PHONE_BILLING_WHOLE_NUMBER; |
| 64 if (location_ == SHIPPING_ADDRESS) | 64 if (location_ == SHIPPING_ADDRESS) |
| 65 return PHONE_HOME_WHOLE_NUMBER; | 65 return PHONE_HOME_WHOLE_NUMBER; |
| 66 break; | 66 break; |
| 67 | 67 |
| 68 case INVALID_POSTAL_CODE: | 68 case INVALID_POSTAL_CODE: |
| 69 case INVALID_CITY: | 69 case INVALID_CITY: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 return form_field_error; | 146 return form_field_error; |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool FormFieldError::operator==(const FormFieldError& other) const { | 149 bool FormFieldError::operator==(const FormFieldError& other) const { |
| 150 return error_type_ == other.error_type_ && location_ == other.location_; | 150 return error_type_ == other.error_type_ && location_ == other.location_; |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace wallet | 153 } // namespace wallet |
| 154 } // namespace autofill | 154 } // namespace autofill |
| OLD | NEW |