Chromium Code Reviews| Index: chrome/browser/ui/autofill/autofill_dialog_common.cc |
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_common.cc b/chrome/browser/ui/autofill/autofill_dialog_common.cc |
| index 0c4ef13ecee695e701b7023c790066d4be274e65..51b4006414a2055ce578ae7428f333fecb871596 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_common.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_common.cc |
| @@ -4,6 +4,7 @@ |
| #include "chrome/browser/ui/autofill/autofill_dialog_common.h" |
| +#include "base/strings/utf_string_conversions.h" |
| #include "chrome/browser/browser_process.h" |
| #include "components/autofill/core/browser/autofill_country.h" |
| #include "components/autofill/core/browser/autofill_field.h" |
| @@ -203,10 +204,19 @@ void BuildInputsForSection(DialogSection dialog_section, |
| case SECTION_CC_BILLING: |
| BuildInputs(kCCInputs, arraysize(kCCInputs), inputs); |
| - if (IsI18nInputEnabled()) |
| - BuildI18nAddressInputs(ADDRESS_TYPE_BILLING, country_code, inputs); |
| - else |
| + if (IsI18nInputEnabled()) { |
| + // Wallet only supports US billing addresses. |
| + const std::string hardcoded_country_code = "US"; |
| + BuildI18nAddressInputs(ADDRESS_TYPE_BILLING, |
| + hardcoded_country_code, |
| + inputs); |
| + DCHECK_EQ(inputs->back().type, ADDRESS_HOME_COUNTRY); |
|
Dan Beam
2014/02/08 03:43:09
^ did you mean ADDRESS_BILLING_COUNTRY?
Evan Stade
2014/02/10 19:07:31
probably
|
| + inputs->back().length = DetailInput::NONE; |
| + inputs->back().initial_value = |
| + base::ASCIIToUTF16(hardcoded_country_code); |
| + } else { |
| BuildInputs(kBillingInputs, arraysize(kBillingInputs), inputs); |
| + } |
| BuildInputs(kBillingPhoneInputs, arraysize(kBillingPhoneInputs), inputs); |
| break; |
| @@ -265,8 +275,7 @@ AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent( |
| base::string16 GetHardcodedValueForType(ServerFieldType type) { |
| // TODO(dbeam): remove this entire function when i18n inputs are the default. |
| - if (IsI18nInputEnabled()) |
| - return base::string16(); |
| + DCHECK(!IsI18nInputEnabled()); |
| if (AutofillType(type).GetStorableType() == ADDRESS_HOME_COUNTRY) { |
| AutofillCountry country("US", g_browser_process->GetApplicationLocale()); |