diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 02:04:41 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 02:04:41 +0000 |
commit | ddbf30172076500e7b5715201ad7f528f7b3a4d6 (patch) | |
tree | f0c468f70520cbda8ed6f73143a329bf944d68f7 /webkit/glue/webframe_impl.h | |
parent | ac82401483eb837c35ea54402cf10ad2393817c4 (diff) | |
download | chromium_src-ddbf30172076500e7b5715201ad7f528f7b3a4d6.zip chromium_src-ddbf30172076500e7b5715201ad7f528f7b3a4d6.tar.gz chromium_src-ddbf30172076500e7b5715201ad7f528f7b3a4d6.tar.bz2 |
Review URL: http://codereview.chromium.org/11306
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframe_impl.h')
-rw-r--r-- | webkit/glue/webframe_impl.h | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index d50762d..b3b241a 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -33,7 +33,7 @@ #include "base/gfx/platform_canvas.h" #include "base/scoped_ptr.h" #include "base/task.h" -#include "webkit/glue/password_autocomplete_listener.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" @@ -271,20 +271,14 @@ class WebFrameImpl : public WebFrame { virtual bool IsReloadAllowingStaleData() const; - // Registers a listener for the specified user name input element. The - // listener will receive notifications for blur and when autocomplete should - // be triggered. - // The WebFrameImpl becomes the owner of the passed listener. - void RegisterPasswordListener( - PassRefPtr<WebCore::HTMLInputElement> user_name_input_element, - webkit_glue::PasswordAutocompleteListener* listener); - - // Returns the password autocomplete listener associated with the passed - // user name input element, or NULL if none available. - // Note that the returned listener is owner by the WebFrameImpl and should not - // be kept around as it is deleted when the page goes away. - webkit_glue::PasswordAutocompleteListener* GetPasswordListener( - WebCore::HTMLInputElement* user_name_input_element); + // 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; @@ -446,20 +440,14 @@ class WebFrameImpl : public WebFrame { const WebCore::SubstituteData& data, bool replace); - // Clears the map of password listeners. - void ClearPasswordListeners(); - // In "printing" mode. Used as a state check. bool printing_; // For each printed page, the view of the document in pixels. Vector<WebCore::IntRect> pages_; - // The input fields that are interested in edit events and their associated - // listeners. - typedef HashMap<RefPtr<WebCore::HTMLInputElement>, - webkit_glue::PasswordAutocompleteListener*> PasswordListenerMap; - PasswordListenerMap password_listeners_; + // The listener responsible for showing form autocomplete suggestions. + RefPtr<webkit_glue::AutocompleteBodyListener> form_autocomplete_listener_; DISALLOW_COPY_AND_ASSIGN(WebFrameImpl); }; |