| Index: third_party/libaddressinput/chromium/libaddressinput_util.cc
|
| diff --git a/third_party/libaddressinput/chromium/libaddressinput_util.cc b/third_party/libaddressinput/chromium/libaddressinput_util.cc
|
| index 18c0fccf84dc92cc38017ae6caf32331d021db70..11f675fce5ff3b42c43d525ec7b69eab58742328 100644
|
| --- a/third_party/libaddressinput/chromium/libaddressinput_util.cc
|
| +++ b/third_party/libaddressinput/chromium/libaddressinput_util.cc
|
| @@ -8,8 +8,8 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| -#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h"
|
| -#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_metadata.h"
|
| +#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_data.h"
|
| +#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_metadata.h"
|
|
|
| namespace autofill {
|
| namespace addressinput {
|
| @@ -21,31 +21,31 @@ using ::i18n::addressinput::AddressField;
|
| using ::i18n::addressinput::AddressProblem;
|
| using ::i18n::addressinput::IsFieldRequired;
|
|
|
| +using ::i18n::addressinput::MISSING_REQUIRED_FIELD;
|
| +
|
| // Based on ::i18n::addressinput::ValidationTask::ShouldReport().
|
| -bool ShouldReport(
|
| - const std::multimap<AddressField, AddressProblem::Type>* filter,
|
| - AddressField field,
|
| - AddressProblem::Type problem) {
|
| +bool ShouldReport(const std::multimap<AddressField, AddressProblem>* filter,
|
| + AddressField field,
|
| + AddressProblem problem) {
|
| return filter == NULL || filter->empty() ||
|
| - std::find(
|
| - filter->begin(),
|
| - filter->end(),
|
| - std::multimap<AddressField, AddressProblem::Type>::value_type(
|
| - field, problem)) != filter->end();
|
| + std::find(filter->begin(),
|
| + filter->end(),
|
| + std::multimap<AddressField, AddressProblem>::value_type(
|
| + field, problem)) != filter->end();
|
| }
|
|
|
| } // namespace
|
|
|
| bool HasAllRequiredFields(const AddressData& address_to_check) {
|
| - std::multimap<AddressField, AddressProblem::Type> problems;
|
| + std::multimap<AddressField, AddressProblem> problems;
|
| ValidateRequiredFields(address_to_check, NULL, &problems);
|
| return problems.empty();
|
| }
|
|
|
| void ValidateRequiredFields(
|
| const AddressData& address_to_check,
|
| - const std::multimap<AddressField, AddressProblem::Type>* filter,
|
| - std::multimap<AddressField, AddressProblem::Type>* problems) {
|
| + const std::multimap<AddressField, AddressProblem>* filter,
|
| + std::multimap<AddressField, AddressProblem>* problems) {
|
| DCHECK(problems);
|
|
|
| static const AddressField kFields[] = {
|
| @@ -62,9 +62,8 @@ void ValidateRequiredFields(
|
| AddressField field = kFields[i];
|
| if (address_to_check.IsFieldEmpty(field) &&
|
| IsFieldRequired(field, address_to_check.region_code) &&
|
| - ShouldReport(filter, field, AddressProblem::MISSING_REQUIRED_FIELD)) {
|
| - problems->insert(
|
| - std::make_pair(field, AddressProblem::MISSING_REQUIRED_FIELD));
|
| + ShouldReport(filter, field, MISSING_REQUIRED_FIELD)) {
|
| + problems->insert(std::make_pair(field, MISSING_REQUIRED_FIELD));
|
| }
|
| }
|
| }
|
|
|