Index: chrome/renderer/autofill/password_autofill_manager.cc |
diff --git a/chrome/renderer/autofill/password_autofill_manager.cc b/chrome/renderer/autofill/password_autofill_manager.cc |
index 65dba44df5f7d4a1758b58f49681c7aabdfacc10..2b4d49de4d084a59117101af9f7c61cbad638b84 100644 |
--- a/chrome/renderer/autofill/password_autofill_manager.cc |
+++ b/chrome/renderer/autofill/password_autofill_manager.cc |
@@ -8,6 +8,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
#include "chrome/common/autofill_messages.h" |
+#include "chrome/renderer/autofill/form_autofill_util.h" |
#include "content/public/renderer/render_view.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
@@ -332,6 +333,20 @@ bool PasswordAutofillManager::DidClearAutofillSelection( |
return FindLoginInfo(node, &input, &password); |
} |
+void PasswordAutofillManager::HandleKeyDown(const WebKit::WebInputElement& node, |
+ int key_code) { |
+ LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(node); |
+ if (iter == login_to_password_info_.end()) { |
+ // The browser code should only send this message when it knows we have a |
+ // match. |
+ NOTREACHED(); |
+ return; |
+ } |
+ |
+ iter->second.backspace_pressed_last = |
+ (key_code == ui::VKEY_BACK || key_code == ui::VKEY_DELETE); |
+} |
+ |
void PasswordAutofillManager::SendPasswordForms(WebKit::WebFrame* frame, |
bool only_visible) { |
// Make sure that this security origin is allowed to use password manager. |
@@ -443,6 +458,16 @@ void PasswordAutofillManager::OnFillPasswordForm( |
password_info.fill_data = form_data; |
password_info.password_field = password_element; |
login_to_password_info_[username_element] = password_info; |
+ |
+ webkit::forms::FormData form; |
+ webkit::forms::FormField field; |
+ FindFormAndFieldForInputElement( |
+ username_element, &form, &field, REQUIRE_NONE); |
+ Send(new AutofillHostMsg_FillPasswordForm( |
+ routing_id(), |
+ field, |
+ form_data, |
+ username_element.document().frame()->identifier())); |
} |
} |
@@ -569,6 +594,9 @@ void PasswordAutofillManager::FrameClosing(const WebKit::WebFrame* frame) { |
else |
++iter; |
} |
+ |
+ // Inform the Browser-side Password Manager of the closing frame. |
+ Send(new AutofillHostMsg_FrameClosing(routing_id(), frame->identifier())); |
} |
bool PasswordAutofillManager::FindLoginInfo( |