Chromium Code Reviews| Index: components/autofill/core/browser/autofill_address_util.cc |
| diff --git a/components/autofill/core/browser/autofill_address_util.cc b/components/autofill/core/browser/autofill_address_util.cc |
| index c232e0026513379e93b646177282b74d02c7b41f..058a7dc0da251eede853b094fa09d79a5a844c08 100644 |
| --- a/components/autofill/core/browser/autofill_address_util.cc |
| +++ b/components/autofill/core/browser/autofill_address_util.cc |
| @@ -11,7 +11,6 @@ |
| #include "base/values.h" |
| #include "components/autofill/core/browser/autofill_country.h" |
| #include "components/autofill/core/browser/country_combobox_model.h" |
| -#include "components/autofill/core/browser/field_types.h" |
| #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui.h" |
| #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui_component.h" |
| #include "third_party/libaddressinput/src/cpp/include/libaddressinput/localization.h" |
| @@ -43,6 +42,29 @@ const char kCountryField[] = "country"; |
| const char kShortField[] = "short"; |
| const char kLongField[] = "long"; |
| +ServerFieldType GetFieldTypeFromString(const std::string& type) { |
| + if (type == kFullNameField) |
| + return NAME_FULL; |
| + if (type == kCompanyNameField) |
| + return COMPANY_NAME; |
| + if (type == kAddressLineField) |
| + return ADDRESS_HOME_STREET_ADDRESS; |
| + if (type == kDependentLocalityField) |
| + return ADDRESS_HOME_DEPENDENT_LOCALITY; |
| + if (type == kCityField) |
| + return ADDRESS_HOME_CITY; |
| + if (type == kStateField) |
| + return ADDRESS_HOME_STATE; |
| + if (type == kPostalCodeField) |
| + return ADDRESS_HOME_ZIP; |
| + if (type == kSortingCodeField) |
| + return ADDRESS_HOME_SORTING_CODE; |
| + if (type == kCountryField) |
| + return ADDRESS_HOME_COUNTRY; |
| + NOTREACHED(); |
|
please use gerrit instead
2017/05/19 18:46:53
#include "base/logging.h"
Moe
2017/05/19 19:09:12
Done.
|
| + return UNKNOWN_TYPE; |
| +} |
| + |
| // Fills |components| with the address UI components that should be used to |
| // input an address for |country_code| when UI BCP 47 language code is |
| // |ui_language_code|. If |components_language_code| is not NULL, then sets it |