Chromium Code Reviews| Index: components/autofill/core/browser/personal_data_manager.cc |
| diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc |
| index d7ea312bc99a8293421bccf8be9dce660756c446..16d7739ad8dcf2fd88c84bf44172808be58acabc 100644 |
| --- a/components/autofill/core/browser/personal_data_manager.cc |
| +++ b/components/autofill/core/browser/personal_data_manager.cc |
| @@ -24,6 +24,9 @@ |
| #include "components/autofill/core/browser/phone_number_i18n.h" |
| #include "components/autofill/core/browser/validation.h" |
| #include "components/autofill/core/common/autofill_pref_names.h" |
| +#include "third_party/libaddressinput/chromium/cpp/src/region_data_constants.h" |
| + |
| +using ::i18n::addressinput::RegionDataConstants; |
| namespace autofill { |
| namespace { |
| @@ -566,7 +569,18 @@ void PersonalDataManager::GetProfileSuggestions( |
| std::vector<base::string16> multi_values; |
| profile->GetMultiInfo(type, app_locale_, &multi_values); |
| + // Names need to be in vertically compact form - i.e. a single line. Join |
| + // multi-line addresses into a single line, using a separator. |
| + // The separator is locale-specific. |
| + base::string16 compact_separator = |
| + base::UTF8ToUTF16(RegionDataConstants::GetLanguageCompactLineSeparator( |
| + profile->language_code())); |
| for (size_t i = 0; i < multi_values.size(); ++i) { |
| + // Create vertically compact form. |
| + base::ReplaceChars(multi_values[i], |
| + base::UTF8ToUTF16("\n"), |
|
Evan Stade
2014/07/10 20:25:03
nit: ASCIIToUTF16
groby-ooo-7-16
2014/07/11 19:30:30
Done.
|
| + compact_separator, |
| + &multi_values[i]); |
| if (!field_is_autofilled) { |
| // Suggest data that starts with what the user has typed. |
| if (!multi_values[i].empty() && |