| 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 c0a12764613f4a355d98ef5f307460792df5d3c7..aa9fafaebfeae3f02505961779ed212695fc8cc3 100644
|
| --- a/components/autofill/content/renderer/password_autofill_agent.cc
|
| +++ b/components/autofill/content/renderer/password_autofill_agent.cc
|
| @@ -967,6 +967,8 @@ bool PasswordAutofillAgent::OnMessageReceived(const IPC::Message& message) {
|
| IPC_MESSAGE_HANDLER(AutofillMsg_SetLoggingState, OnSetLoggingState)
|
| IPC_MESSAGE_HANDLER(AutofillMsg_AutofillUsernameAndPasswordDataReceived,
|
| OnAutofillUsernameAndPasswordDataReceived)
|
| + IPC_MESSAGE_HANDLER(AutofillMsg_FindFocusedPasswordForm,
|
| + OnFindFocusedPasswordForm)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| return handled;
|
| @@ -1241,6 +1243,25 @@ void PasswordAutofillAgent::OnAutofillUsernameAndPasswordDataReceived(
|
| form_predictions_ = predictions;
|
| }
|
|
|
| +void PasswordAutofillAgent::OnFindFocusedPasswordForm() {
|
| + scoped_ptr<PasswordForm> password_form;
|
| +
|
| + blink::WebElement element = render_frame()->GetFocusedElement();
|
| + if (!element.isNull() && element.hasHTMLTagName("input")) {
|
| + blink::WebInputElement input = element.to<blink::WebInputElement>();
|
| + if (input.isPasswordField() && !input.form().isNull()) {
|
| + password_form = CreatePasswordForm(
|
| + input.form(), &nonscript_modified_values_, &form_predictions_);
|
| + }
|
| + }
|
| +
|
| + if (!password_form.get())
|
| + password_form.reset(new PasswordForm());
|
| +
|
| + Send(new AutofillHostMsg_FocusedPasswordFormFound(
|
| + routing_id(), *password_form));
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // PasswordAutofillAgent, private:
|
|
|
|
|