Chromium Code Reviews| 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..013c588643963ffe8e0ad345130c6d996bf40c98 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( |
|
Mike West
2015/03/25 10:24:57
Nit: This should be named in line what whatever yo
dvadym
2015/03/25 16:34:07
Done.
|
| + const std::map<autofill::FormData, autofill::FormFieldData>& predictions) { |
| + form_predictions_ = predictions; |
|
Mike West
2015/03/25 10:24:57
Is there any sanity checking you can do here? How
dvadym
2015/03/25 16:34:07
I don't expect anything in code. In case where it
|
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // 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())) { |