diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-17 22:04:00 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-17 22:04:00 +0000 |
commit | 5f9b16e96cc1bd69df3aa064233f49573da74274 (patch) | |
tree | a0151ba7058b487df02f965d1aff4ea8e7c96007 /webkit/glue/dom_operations.cc | |
parent | 019d50c3d479f5cf48934dc454c7f9f824bb4a1b (diff) | |
download | chromium_src-5f9b16e96cc1bd69df3aa064233f49573da74274.zip chromium_src-5f9b16e96cc1bd69df3aa064233f49573da74274.tar.gz chromium_src-5f9b16e96cc1bd69df3aa064233f49573da74274.tar.bz2 |
The password manager and the form autofill feature were listening for events on text input elements by registering a listener on each element. This is slowing down the page load.
This CL changes that to only 1 listener on the body of the page, that forwards the events to element specific listeners.
BUG=None
TEST=Run the test shell unit tests
Review URL: http://codereview.chromium.org/10844
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_operations.cc')
-rw-r--r-- | webkit/glue/dom_operations.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc index 9e15d8a..6b560c8 100644 --- a/webkit/glue/dom_operations.cc +++ b/webkit/glue/dom_operations.cc @@ -445,11 +445,16 @@ void FillPasswordForm(WebView* view, WebCore::HTMLInputElement* password_element = form_elements->input_elements[data.basic_data.elements[1]].get(); - AttachForInlineAutocomplete(username_element, - new PasswordAutocompleteListener( - new HTMLInputDelegate(username_element), - new HTMLInputDelegate(password_element), - data)); + WebFrameLoaderClient* frame_loader_client = + static_cast<WebFrameLoaderClient*>(username_element->document()-> + frame()->loader()->client()); + WebFrameImpl* webframe_impl = frame_loader_client->webframe(); + webframe_impl->GetAutocompleteListener()->AddInputListener( + username_element, + new PasswordAutocompleteListener( + new HTMLInputDelegate(username_element), + new HTMLInputDelegate(password_element), + data)); } } |