| 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 214963dc23d91130d0c6b67e4c69232b2c2d299e..9c7233f953d4470364c0edc98a207f8e4f07751c 100644
|
| --- a/components/autofill/core/browser/autofill_manager.cc
|
| +++ b/components/autofill/core/browser/autofill_manager.cc
|
| @@ -459,8 +459,13 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
|
| GetCreditCardSuggestions(
|
| field, type, &values, &labels, &icons, &unique_ids);
|
| } else {
|
| - GetProfileSuggestions(
|
| - *form_structure, field, type, &values, &labels, &icons, &unique_ids);
|
| + GetProfileSuggestions(*form_structure,
|
| + field,
|
| + *autofill_field,
|
| + &values,
|
| + &labels,
|
| + &icons,
|
| + &unique_ids);
|
| }
|
|
|
| DCHECK_EQ(values.size(), labels.size());
|
| @@ -1064,7 +1069,7 @@ bool AutofillManager::UpdateCachedForm(const FormData& live_form,
|
| void AutofillManager::GetProfileSuggestions(
|
| const FormStructure& form,
|
| const FormFieldData& field,
|
| - const AutofillType& type,
|
| + const AutofillField& autofill_field,
|
| std::vector<base::string16>* values,
|
| std::vector<base::string16>* labels,
|
| std::vector<base::string16>* icons,
|
| @@ -1076,10 +1081,18 @@ void AutofillManager::GetProfileSuggestions(
|
| std::vector<GUIDPair> guid_pairs;
|
|
|
| personal_data_->GetProfileSuggestions(
|
| - type, field.value, field.is_autofilled, field_types,
|
| + autofill_field.Type(), field.value, field.is_autofilled, field_types,
|
| base::Callback<bool(const AutofillProfile&)>(),
|
| values, labels, icons, &guid_pairs);
|
|
|
| + // Adjust phone number to display in prefix/suffix case.
|
| + if (autofill_field.Type().GetStorableType() == PHONE_HOME_NUMBER) {
|
| + for (size_t i = 0; i < values->size(); ++i) {
|
| + (*values)[i] = AutofillField::GetPhoneNumberValue(
|
| + autofill_field, (*values)[i], field);
|
| + }
|
| + }
|
| +
|
| for (size_t i = 0; i < guid_pairs.size(); ++i) {
|
| unique_ids->push_back(PackGUIDs(GUIDPair(std::string(), 0),
|
| guid_pairs[i]));
|
|
|