Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: webkit/glue/webframe_impl.h

Issue 11479: New take at implementing autofill using the editor client API (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/password_autocomplete_listener_unittest.cc ('k') | webkit/glue/webframe_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webframe_impl.h
===================================================================
--- webkit/glue/webframe_impl.h (revision 5578)
+++ webkit/glue/webframe_impl.h (working copy)
@@ -33,7 +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/password_autocomplete_listener.h"
#include "webkit/glue/webdatasource_impl.h"
#include "webkit/glue/webframe.h"
#include "webkit/glue/webframeloaderclient_impl.h"
@@ -271,14 +271,20 @@
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();
+ // 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);
- // 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();
+ // 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);
protected:
friend class WebFrameLoaderClient;
@@ -440,14 +446,20 @@
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 listener responsible for showing form autocomplete suggestions.
- RefPtr<webkit_glue::AutocompleteBodyListener> form_autocomplete_listener_;
+ // 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_;
DISALLOW_COPY_AND_ASSIGN(WebFrameImpl);
};
« no previous file with comments | « webkit/glue/password_autocomplete_listener_unittest.cc ('k') | webkit/glue/webframe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698