Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_common.cc

Issue 212873003: Store the language code for the address in autofill profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixups Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 5c3b801cd3af2e30e75418cbfaf4a43a9ac0e1f4..dc58d58009f4a0d400907b48b46dbe1bf1b82fe8 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_common.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_common.cc
@@ -96,18 +96,21 @@ bool IsI18nInputEnabled() {
void BuildI18nAddressInputs(AddressType address_type,
const std::string& country_code,
- DetailInputs* inputs) {
+ DetailInputs* inputs,
+ std::string* language_code) {
#if defined(OS_ANDROID)
NOTREACHED();
#else
- i18ninput::BuildAddressInputs(address_type, country_code, inputs);
+ i18ninput::BuildAddressInputs(address_type, country_code, inputs,
+ language_code);
#endif
}
// Constructs |inputs| from template data for a given |dialog_section|.
void BuildInputsForSection(DialogSection dialog_section,
const std::string& country_code,
- DetailInputs* inputs) {
+ DetailInputs* inputs,
+ std::string* language_code) {
using l10n_util::GetStringUTF16;
const DetailInput kCCInputs[] = {
@@ -195,10 +198,12 @@ void BuildInputsForSection(DialogSection dialog_section,
break;
case SECTION_BILLING:
- if (IsI18nInputEnabled())
- BuildI18nAddressInputs(ADDRESS_TYPE_BILLING, country_code, inputs);
- else
+ if (IsI18nInputEnabled()) {
+ BuildI18nAddressInputs(ADDRESS_TYPE_BILLING, country_code, inputs,
+ language_code);
+ } else {
BuildInputs(kBillingInputs, arraysize(kBillingInputs), inputs);
+ }
BuildInputs(kBillingPhoneInputs, arraysize(kBillingPhoneInputs), inputs);
BuildInputs(kEmailInputs, arraysize(kEmailInputs), inputs);
@@ -212,7 +217,8 @@ void BuildInputsForSection(DialogSection dialog_section,
const std::string hardcoded_country_code = "US";
BuildI18nAddressInputs(ADDRESS_TYPE_BILLING,
hardcoded_country_code,
- inputs);
+ inputs,
+ language_code);
DCHECK_EQ(inputs->back().type, ADDRESS_BILLING_COUNTRY);
inputs->back().length = DetailInput::NONE;
const std::string& app_locale =
@@ -227,10 +233,12 @@ void BuildInputsForSection(DialogSection dialog_section,
break;
case SECTION_SHIPPING:
- if (IsI18nInputEnabled())
- BuildI18nAddressInputs(ADDRESS_TYPE_SHIPPING, country_code, inputs);
- else
+ if (IsI18nInputEnabled()) {
+ BuildI18nAddressInputs(ADDRESS_TYPE_SHIPPING, country_code, inputs,
+ language_code);
+ } else {
BuildInputs(kShippingInputs, arraysize(kShippingInputs), inputs);
+ }
BuildInputs(
kShippingPhoneInputs, arraysize(kShippingPhoneInputs), inputs);
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_common.h ('k') | chrome/browser/ui/autofill/autofill_dialog_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698