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

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

Issue 13488009: Remove application locale cache in autofill code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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/data_model_wrapper.cc
===================================================================
--- chrome/browser/ui/autofill/data_model_wrapper.cc (revision 192175)
+++ chrome/browser/ui/autofill/data_model_wrapper.cc (working copy)
@@ -6,8 +6,8 @@
#include "base/callback.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/autofill/autofill_dialog_models.h"
-#include "components/autofill/browser/autofill_country.h"
#include "components/autofill/browser/autofill_profile.h"
#include "components/autofill/browser/autofill_type.h"
#include "components/autofill/browser/credit_card.h"
@@ -77,11 +77,12 @@
AutofillFormGroupWrapper::~AutofillFormGroupWrapper() {}
string16 AutofillFormGroupWrapper::GetInfo(AutofillFieldType type) {
- return form_group_->GetInfo(type, AutofillCountry::ApplicationLocale());
+ return form_group_->GetInfo(type, g_browser_process->GetApplicationLocale());
}
void AutofillFormGroupWrapper::FillFormField(AutofillField* field) {
- form_group_->FillFormField(*field, variant_, field);
+ form_group_->FillFormField(
+ *field, variant_, g_browser_process->GetApplicationLocale(), field);
}
// AutofillProfileWrapper
@@ -94,10 +95,11 @@
AutofillProfileWrapper::~AutofillProfileWrapper() {}
void AutofillProfileWrapper::FillInputs(DetailInputs* inputs) {
- const std::string app_locale = AutofillCountry::ApplicationLocale();
for (size_t j = 0; j < inputs->size(); ++j) {
std::vector<string16> values;
- profile_->GetMultiInfo((*inputs)[j].type, app_locale, &values);
+ profile_->GetMultiInfo((*inputs)[j].type,
+ g_browser_process->GetApplicationLocale(),
+ &values);
(*inputs)[j].initial_value = values[variant()];
}
}
@@ -149,7 +151,7 @@
WalletAddressWrapper::~WalletAddressWrapper() {}
string16 WalletAddressWrapper::GetInfo(AutofillFieldType type) {
- return address_->GetInfo(type);
+ return address_->GetInfo(type, g_browser_process->GetApplicationLocale());
}
// WalletInstrumentWrapper
@@ -164,7 +166,7 @@
if (type == CREDIT_CARD_EXP_MONTH)
return MonthComboboxModel::FormatMonth(instrument_->expiration_month());
- return instrument_->GetInfo(type);
+ return instrument_->GetInfo(type, g_browser_process->GetApplicationLocale());
}
gfx::Image WalletInstrumentWrapper::GetIcon() {
@@ -192,7 +194,8 @@
if (AutofillType(type).group() == AutofillType::CREDIT_CARD)
return full_wallet_->GetInfo(type);
- return full_wallet_->billing_address()->GetInfo(type);
+ return full_wallet_->billing_address()->GetInfo(
+ type, g_browser_process->GetApplicationLocale());
}
// FullWalletShippingWrapper
@@ -206,7 +209,8 @@
FullWalletShippingWrapper::~FullWalletShippingWrapper() {}
string16 FullWalletShippingWrapper::GetInfo(AutofillFieldType type) {
- return full_wallet_->shipping_address()->GetInfo(type);
+ return full_wallet_->shipping_address()->GetInfo(
+ type, g_browser_process->GetApplicationLocale());
}
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698