| Index: components/autofill/content/renderer/password_autofill_agent.cc
|
| diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
|
| index 5676472194830851386fb53cd8ce48c8914d5d70..484e581cbae911e0d33fb3885b6ffbff11888142 100644
|
| --- a/components/autofill/content/renderer/password_autofill_agent.cc
|
| +++ b/components/autofill/content/renderer/password_autofill_agent.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "components/autofill/content/renderer/password_autofill_agent.h"
|
|
|
| +#include <vector>
|
| +
|
| #include "base/bind.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/message_loop.h"
|
| @@ -493,15 +495,20 @@ void PasswordAutofillAgent::OnFillPasswordForm(
|
| void PasswordAutofillAgent::GetSuggestions(
|
| const PasswordFormFillData& fill_data,
|
| const base::string16& input,
|
| - std::vector<base::string16>* suggestions) {
|
| - if (StartsWith(fill_data.basic_data.fields[0].value, input, false))
|
| + std::vector<base::string16>* suggestions,
|
| + std::vector<base::string16>* realms) {
|
| + if (StartsWith(fill_data.basic_data.fields[0].value, input, false)) {
|
| suggestions->push_back(fill_data.basic_data.fields[0].value);
|
| + realms->push_back(fill_data.preferred_realm);
|
| + }
|
|
|
| for (PasswordFormFillData::LoginCollection::const_iterator iter =
|
| fill_data.additional_logins.begin();
|
| iter != fill_data.additional_logins.end(); ++iter) {
|
| - if (StartsWith(iter->first, input, false))
|
| + if (StartsWith(iter->first, input, false)) {
|
| suggestions->push_back(iter->first);
|
| + realms->push_back(iter->second.realm);
|
| + }
|
| }
|
|
|
| for (PasswordFormFillData::UsernamesCollection::const_iterator iter =
|
| @@ -528,7 +535,11 @@ bool PasswordAutofillAgent::ShowSuggestionPopup(
|
| return false;
|
|
|
| std::vector<base::string16> suggestions;
|
| - GetSuggestions(fill_data, user_input.value(), &suggestions);
|
| + std::vector<base::string16> suggestions_realms;
|
| + GetSuggestions(fill_data,
|
| + user_input.value(),
|
| + &suggestions,
|
| + &suggestions_realms);
|
|
|
| if (disable_popup_) {
|
| FormData form;
|
| @@ -547,7 +558,8 @@ bool PasswordAutofillAgent::ShowSuggestionPopup(
|
| Send(new AutofillHostMsg_ShowPasswordSuggestions(routing_id(),
|
| field,
|
| bounding_box_scaled,
|
| - suggestions));
|
| + suggestions,
|
| + suggestions_realms));
|
| return !suggestions.empty();
|
| }
|
|
|
| @@ -590,7 +602,7 @@ bool PasswordAutofillAgent::FillUserNameAndPassword(
|
| if (DoUsernamesMatch(iter->first, current_username,
|
| exact_username_match)) {
|
| username = iter->first;
|
| - password = iter->second;
|
| + password = iter->second.password;
|
| break;
|
| }
|
| }
|
|
|