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

Unified Diff: webkit/glue/password_autocomplete_listener.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/form_autocomplete_listener.cc ('k') | webkit/glue/password_autocomplete_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/password_autocomplete_listener.h
===================================================================
--- webkit/glue/password_autocomplete_listener.h (revision 5578)
+++ webkit/glue/password_autocomplete_listener.h (working copy)
@@ -8,21 +8,49 @@
#ifndef WEBKIT_GLUE_PASSWORD_AUTOCOMPLETE_LISTENER_H_
#define WEBKIT_GLUE_PASSWORD_AUTOCOMPLETE_LISTENER_H_
+#include "config.h"
+
+#include "base/compiler_specific.h"
+
+MSVC_PUSH_WARNING_LEVEL(0);
+#include "HTMLInputElement.h"
+MSVC_POP_WARNING();
+
#include "base/basictypes.h"
-#include "webkit/glue/autocomplete_input_listener.h"
+#include "base/scoped_ptr.h"
#include "webkit/glue/password_form_dom_manager.h"
namespace webkit_glue {
-class PasswordAutocompleteListener : public AutocompleteInputListener {
+// A proxy interface to a WebCore::HTMLInputElement for inline autocomplete.
+// The delegate does not own the WebCore element; it only interfaces it.
+class HTMLInputDelegate {
public:
+ explicit HTMLInputDelegate(WebCore::HTMLInputElement* element);
+ virtual ~HTMLInputDelegate();
+
+ virtual void SetValue(const std::wstring& value);
+ virtual void SetSelectionRange(size_t start, size_t end);
+ virtual void OnFinishedAutocompleting();
+
+ private:
+ // The underlying DOM element we're wrapping. We reference the underlying
+ // HTMLInputElement for its lifetime to ensure it does not get freed by
+ // WebCore while in use by the delegate instance.
+ WebCore::HTMLInputElement* element_;
+
+ DISALLOW_COPY_AND_ASSIGN(HTMLInputDelegate);
+};
+
+
+class PasswordAutocompleteListener {
+ public:
PasswordAutocompleteListener(HTMLInputDelegate* username_delegate,
HTMLInputDelegate* password_delegate,
const PasswordFormDomManager::FillData& data);
virtual ~PasswordAutocompleteListener() {
}
- // AutocompleteInputListener implementation.
virtual void OnBlur(WebCore::HTMLInputElement* element,
const std::wstring& user_input);
virtual void OnInlineAutocompleteNeeded(WebCore::HTMLInputElement* element,
@@ -30,8 +58,8 @@
private:
// Check if the input string resembles a potential matching login
- // (username/password) and if so, match them up by autocompleting
- // the edit delegates.
+ // (username/password) and if so, match them up by autocompleting the edit
+ // delegates.
bool TryToMatch(const std::wstring& input,
const std::wstring& username,
const std::wstring& password);
« no previous file with comments | « webkit/glue/form_autocomplete_listener.cc ('k') | webkit/glue/password_autocomplete_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698