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 eb2e06dbe78683c9c03c13020eb30d85bad58718..4f2ca86374ec4aa9e8769fba12fbb4666c9335de 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_AutofillUsernameDataReceived, |
| OnAutofillUsernameDataReceived) |
| + IPC_MESSAGE_HANDLER(AutofillMsg_FindFocusedPasswordForm, |
| + OnFindFocusedPasswordForm) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| return handled; |
| @@ -1241,6 +1243,22 @@ void PasswordAutofillAgent::OnAutofillUsernameDataReceived( |
| form_predictions_ = predictions; |
| } |
| +void PasswordAutofillAgent::OnFindFocusedPasswordForm() { |
| + blink::WebElement element = render_frame()->GetFocusedElement(); |
| + |
| + DCHECK(!element.isNull()); |
|
Mike West
2015/05/29 07:24:49
Hrm. Execution doesn't stop while a context menu i
msramek
2015/05/29 11:57:21
Ehh, thanks for the sanity check.
I also added a
|
| + DCHECK(element.hasHTMLTagName("input")) << |
| + base::UTF16ToASCII(element.tagName()); |
| + |
| + blink::WebInputElement input = element.to<blink::WebInputElement>(); |
| + DCHECK(input.isPasswordField()); |
| + |
| + scoped_ptr<PasswordForm> password_form(CreatePasswordForm( |
| + input.form(), &nonscript_modified_values_, &form_predictions_)); |
| + Send(new AutofillHostMsg_FocusedPasswordFormFound( |
| + routing_id(), *password_form)); |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // PasswordAutofillAgent, private: |