summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webframe_impl.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-17 22:04:00 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-17 22:04:00 +0000
commit5f9b16e96cc1bd69df3aa064233f49573da74274 (patch)
treea0151ba7058b487df02f965d1aff4ea8e7c96007 /webkit/glue/webframe_impl.h
parent019d50c3d479f5cf48934dc454c7f9f824bb4a1b (diff)
downloadchromium_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/webframe_impl.h')
-rw-r--r--webkit/glue/webframe_impl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h
index ce2521a..b3b241a 100644
--- a/webkit/glue/webframe_impl.h
+++ b/webkit/glue/webframe_impl.h
@@ -33,6 +33,7 @@
#include "base/gfx/platform_canvas.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
+#include "webkit/glue/form_autocomplete_listener.h"
#include "webkit/glue/webdatasource_impl.h"
#include "webkit/glue/webframe.h"
#include "webkit/glue/webframeloaderclient_impl.h"
@@ -270,6 +271,15 @@ class WebFrameImpl : public WebFrame {
virtual bool IsReloadAllowingStaleData() const;
+ // Returns the listener used for autocomplete. Creates it and registers it on
+ // the frame body node on the first invocation.
+ webkit_glue::AutocompleteBodyListener* GetAutocompleteListener();
+
+ // Nulls the autocomplete listener for this frame. Useful as a frame might
+ // be reused (on reload for example), in which case a new body element is
+ // created and the existing autocomplete listener becomes useless.
+ void ClearAutocompleteListener();
+
protected:
friend class WebFrameLoaderClient;
@@ -436,6 +446,9 @@ class WebFrameImpl : public WebFrame {
// For each printed page, the view of the document in pixels.
Vector<WebCore::IntRect> pages_;
+ // The listener responsible for showing form autocomplete suggestions.
+ RefPtr<webkit_glue::AutocompleteBodyListener> form_autocomplete_listener_;
+
DISALLOW_COPY_AND_ASSIGN(WebFrameImpl);
};