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 78679f3637b2e55e4d190878b87937ca3e6eccb6..bc46642d55509e1dbc5b930dde19ec7b231b20af 100644 |
--- a/components/autofill/content/renderer/password_autofill_agent.cc |
+++ b/components/autofill/content/renderer/password_autofill_agent.cc |
@@ -914,7 +914,8 @@ void PasswordAutofillAgent::SendPasswordForms(bool only_visible) { |
continue; |
} |
- scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form, nullptr)); |
+ scoped_ptr<PasswordForm> password_form( |
+ CreatePasswordForm(form, nullptr, &form_predictions_)); |
if (password_form.get()) { |
if (logger) { |
logger->LogPasswordForm(Logger::STRING_FORM_IS_PASSWORD, |
@@ -945,6 +946,8 @@ bool PasswordAutofillAgent::OnMessageReceived(const IPC::Message& message) { |
IPC_BEGIN_MESSAGE_MAP(PasswordAutofillAgent, message) |
IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordForm, OnFillPasswordForm) |
IPC_MESSAGE_HANDLER(AutofillMsg_SetLoggingState, OnSetLoggingState) |
+ IPC_MESSAGE_HANDLER(AutofillMsg_AutofillPasswordDataReceived, |
+ OnAutofillDataReceived) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -1029,7 +1032,8 @@ void PasswordAutofillAgent::WillSubmitForm(const blink::WebFormElement& form) { |
LogHTMLForm(logger.get(), Logger::STRING_HTML_FORM_FOR_SUBMIT, form); |
} |
- scoped_ptr<PasswordForm> submitted_form = CreatePasswordForm(form, nullptr); |
+ scoped_ptr<PasswordForm> submitted_form = |
+ CreatePasswordForm(form, nullptr, &form_predictions_); |
// If there is a provisionally saved password, copy over the previous |
// password value so we get the user's typed password, not the value that |
@@ -1114,8 +1118,8 @@ void PasswordAutofillAgent::LegacyDidStartProvisionalLoad( |
LogHTMLForm(logger.get(), Logger::STRING_FORM_FOUND_ON_PAGE, |
form_element); |
} |
- scoped_ptr<PasswordForm> password_form( |
- CreatePasswordForm(form_element, &nonscript_modified_values_)); |
+ scoped_ptr<PasswordForm> password_form(CreatePasswordForm( |
+ form_element, &nonscript_modified_values_, &form_predictions_)); |
if (password_form.get() && !password_form->username_value.empty() && |
FormContainsNonDefaultPasswordValue(*password_form, form_element)) { |
password_forms_found = true; |
@@ -1205,6 +1209,11 @@ void PasswordAutofillAgent::OnSetLoggingState(bool active) { |
logging_state_active_ = active; |
} |
+void PasswordAutofillAgent::OnAutofillDataReceived( |
+ const std::vector<autofill::FormDataPredictions>& forms) { |
+ form_predictions_ = forms; |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// PasswordAutofillAgent, private: |
@@ -1355,8 +1364,8 @@ void PasswordAutofillAgent::ClearPreview( |
void PasswordAutofillAgent::ProvisionallySavePassword( |
const blink::WebFormElement& form, |
ProvisionallySaveRestriction restriction) { |
- scoped_ptr<PasswordForm> password_form( |
- CreatePasswordForm(form, &nonscript_modified_values_)); |
+ scoped_ptr<PasswordForm> password_form(CreatePasswordForm( |
+ form, &nonscript_modified_values_, &form_predictions_)); |
if (!password_form || (restriction == RESTRICTION_NON_EMPTY_PASSWORD && |
password_form->password_value.empty() && |
password_form->new_password_value.empty())) { |