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

Unified Diff: components/autofill/browser/credit_card.cc

Issue 13488009: Remove application locale cache in autofill code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 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
« no previous file with comments | « components/autofill/browser/credit_card.h ('k') | components/autofill/browser/credit_card_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/browser/credit_card.cc
===================================================================
--- components/autofill/browser/credit_card.cc (revision 192613)
+++ components/autofill/browser/credit_card.cc (working copy)
@@ -17,7 +17,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/utf_string_conversions.h"
-#include "components/autofill/browser/autofill_country.h"
#include "components/autofill/browser/autofill_field.h"
#include "components/autofill/browser/autofill_regexes.h"
#include "components/autofill/browser/autofill_type.h"
@@ -512,14 +511,13 @@
void CreditCard::FillFormField(const AutofillField& field,
size_t /*variant*/,
+ const std::string& app_locale,
FormFieldData* field_data) const {
DCHECK_EQ(AutofillType::CREDIT_CARD, AutofillType(field.type()).group());
DCHECK(field_data);
- const std::string app_locale = AutofillCountry::ApplicationLocale();
-
if (field_data->form_control_type == "select-one") {
- FillSelectControl(field.type(), field_data);
+ FillSelectControl(field.type(), app_locale, field_data);
} else if (field_data->form_control_type == "month") {
// HTML5 input="month" consists of year-month.
string16 year = GetInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, app_locale);
@@ -563,9 +561,9 @@
return !operator==(credit_card);
}
-bool CreditCard::IsEmpty() const {
+bool CreditCard::IsEmpty(const std::string& app_locale) const {
FieldTypeSet types;
- GetNonEmptyTypes(AutofillCountry::ApplicationLocale(), &types);
+ GetNonEmptyTypes(app_locale, &types);
return types.empty();
}
« no previous file with comments | « components/autofill/browser/credit_card.h ('k') | components/autofill/browser/credit_card_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698