Chromium Code Reviews| Index: components/autofill/core/common/password_form_fill_data.cc |
| diff --git a/components/autofill/core/common/password_form_fill_data.cc b/components/autofill/core/common/password_form_fill_data.cc |
| index a75d9c5e3cac79f8def31eabcda66818e77f9434..82882dd32a899479bea830448dfe7f17539d7913 100644 |
| --- a/components/autofill/core/common/password_form_fill_data.cc |
| +++ b/components/autofill/core/common/password_form_fill_data.cc |
| @@ -11,6 +11,20 @@ |
| namespace autofill { |
| +namespace { |
| + |
| +// Extracts username values from |values_and_field_names| and inserts to |
| +// |values|. |
| +void InsertUsernameValues(const PossibleUsernamesVector& values_and_field_names, |
| + std::vector<base::string16>* values) { |
| + DCHECK(values && values->empty()); |
| + |
| + for (auto& pair : values_and_field_names) |
|
vabr (Chromium)
2017/03/16 21:00:42
nit: const auto&
While the compiler deduces that t
|
| + values->push_back(pair.first); |
| +} |
| + |
| +} // namespace |
| + |
| UsernamesCollectionKey::UsernamesCollectionKey() {} |
| UsernamesCollectionKey::~UsernamesCollectionKey() {} |
| @@ -84,8 +98,8 @@ void InitPasswordFormFillData( |
| if (it.second->is_public_suffix_match || |
| it.second->is_affiliation_based_match) |
| key.realm = it.second->signon_realm; |
| - result->other_possible_usernames[key] = |
| - it.second->other_possible_usernames; |
| + InsertUsernameValues(it.second->other_possible_usernames, |
| + &result->other_possible_usernames[key]); |
| } |
| } |
| } |