Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
index ec41f89602dcf84152fa929b076ceec5286851a1..f79a785fa3151a35b29af3ed3b94dd2e7855d1cf 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
@@ -54,6 +54,7 @@ |
#include "components/autofill/content/browser/wallet/wallet_items.h" |
#include "components/autofill/content/browser/wallet/wallet_service_url.h" |
#include "components/autofill/content/browser/wallet/wallet_signin_helper.h" |
+#include "components/autofill/core/browser/address_i18n.h" |
#include "components/autofill/core/browser/autofill_country.h" |
#include "components/autofill/core/browser/autofill_data_model.h" |
#include "components/autofill/core/browser/autofill_manager.h" |
@@ -530,12 +531,11 @@ base::string16 GetInfoFromProfile(const AutofillProfile& profile, |
void CanonicalizeState(const AddressValidator* validator, |
AutofillProfile* profile) { |
base::string16 administrative_area; |
- AddressData address_data; |
- i18ninput::CreateAddressData(base::Bind(&GetInfoFromProfile, *profile), |
- &address_data); |
+ scoped_ptr<AddressData> address_data = |
+ i18n::CreateAddressData(base::Bind(&GetInfoFromProfile, *profile)); |
- validator->CanonicalizeAdministrativeArea(&address_data); |
- administrative_area = base::UTF8ToUTF16(address_data.administrative_area); |
+ validator->CanonicalizeAdministrativeArea(address_data.get()); |
+ administrative_area = base::UTF8ToUTF16(address_data->administrative_area); |
profile->SetInfo(AutofillType(ADDRESS_HOME_STATE), |
administrative_area, |
@@ -1963,13 +1963,12 @@ ValidityMessages AutofillDialogControllerImpl::InputsAreValid( |
if (section != SECTION_CC) { |
AutofillProfile profile; |
FillFormGroupFromOutputs(inputs, &profile); |
- AddressData address_data; |
- i18ninput::CreateAddressData(base::Bind(&GetInfoFromProfile, profile), |
- &address_data); |
- address_data.language_code = AddressLanguageCodeForSection(section); |
+ scoped_ptr<AddressData> address_data = |
+ i18n::CreateAddressData(base::Bind(&GetInfoFromProfile, profile)); |
+ address_data->language_code = AddressLanguageCodeForSection(section); |
AddressProblems problems; |
- status = GetValidator()->ValidateAddress(address_data, |
+ status = GetValidator()->ValidateAddress(*address_data, |
AddressProblemFilter(), |
&problems); |
common::AddressType address_type = section == SECTION_SHIPPING ? |
@@ -3356,14 +3355,13 @@ void AutofillDialogControllerImpl::GetI18nValidatorSuggestions( |
AutofillProfile profile; |
FillFormGroupFromOutputs(inputs, &profile); |
- AddressData user_input; |
- i18ninput::CreateAddressData( |
- base::Bind(&GetInfoFromProfile, profile), &user_input); |
- user_input.language_code = AddressLanguageCodeForSection(section); |
+ scoped_ptr<AddressData> user_input = |
+ i18n::CreateAddressData(base::Bind(&GetInfoFromProfile, profile)); |
+ user_input->language_code = AddressLanguageCodeForSection(section); |
static const size_t kSuggestionsLimit = 10; |
AddressValidator::Status status = GetValidator()->GetSuggestions( |
- user_input, focused_field, kSuggestionsLimit, |
+ *user_input, focused_field, kSuggestionsLimit, |
&i18n_validator_suggestions_); |
if (status != AddressValidator::SUCCESS) |
@@ -3580,12 +3578,11 @@ bool AutofillDialogControllerImpl::IsCreditCardExpirationValid( |
bool AutofillDialogControllerImpl::HasInvalidAddress( |
const AutofillProfile& profile) { |
- AddressData address_data; |
- i18ninput::CreateAddressData(base::Bind(&GetInfoFromProfile, profile), |
- &address_data); |
+ scoped_ptr<AddressData> address_data = |
+ i18n::CreateAddressData(base::Bind(&GetInfoFromProfile, profile)); |
AddressProblems problems; |
- GetValidator()->ValidateAddress(address_data, |
+ GetValidator()->ValidateAddress(*address_data, |
AddressProblemFilter(), |
&problems); |
return !problems.empty(); |