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

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 397233002: Use language-specific street address line separators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android compile. Created 6 years, 5 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: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index cb4be9320a3c4b578a40564f83c59c8739784dd6..77fc9463a03c68469d45c62373297368310af7ad 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -550,9 +550,12 @@ void AutofillManager::FillOrPreviewForm(
FormData result = form;
base::string16 profile_full_name;
+ std::string profile_language_code;
if (!is_credit_card) {
profile_full_name = data_model->GetInfo(
AutofillType(NAME_FULL), app_locale_);
+ profile_language_code =
+ static_cast<const AutofillProfile*>(data_model)->language_code();
}
// If the relevant section is auto-filled, we should fill |field| but not the
@@ -563,8 +566,11 @@ void AutofillManager::FillOrPreviewForm(
if ((*iter) == field) {
base::string16 value = data_model->GetInfoForVariant(
autofill_field->Type(), variant, app_locale_);
- if (AutofillField::FillFormField(
- *autofill_field, value, app_locale_, &(*iter))) {
+ if (AutofillField::FillFormField(*autofill_field,
+ value,
+ profile_language_code,
+ app_locale_,
+ &(*iter))) {
// Mark the cached field as autofilled, so that we can detect when a
// user edits an autofilled field (for metrics).
autofill_field->is_autofilled = true;
@@ -620,8 +626,11 @@ void AutofillManager::FillOrPreviewForm(
(result.fields[i] == field ||
result.fields[i].form_control_type == "select-one" ||
result.fields[i].value.empty());
- if (AutofillField::FillFormField(
- *cached_field, value, app_locale_, &result.fields[i])) {
+ if (AutofillField::FillFormField(*cached_field,
+ value,
+ profile_language_code,
+ app_locale_,
+ &result.fields[i])) {
// Mark the cached field as autofilled, so that we can detect when a
// user edits an autofilled field (for metrics).
form_structure->field(i)->is_autofilled = true;
« no previous file with comments | « components/autofill/core/browser/autofill_field_unittest.cc ('k') | components/autofill/core/browser/form_structure.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698