From c95d7f499ee3250e2d4a51f7e8f04bb6ebfc6add Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 10 Sep 2010 21:21:28 +0100 Subject: Integrate AutoFill with WebTextView in Java. Adds the necessary JNI hooks so that when the user focuses a form field that AutoFill has identified as "autofillable", the Java side WebTextView will show an option in the auto complete drop down box that when selected will call back to AutoFill in native code and actually fill out the form. AutoFill is still disabled at compile time by default. To test the feature set ENABLE_AUTOFILL=true and rebuild WebKit. Needs a corresponding frameworks/base change. Change-Id: Ie76ff9cbf0b44f3f3644079ed64ce71bfbc9859a --- WebKit/android/WebCoreSupport/autofill/WebAutoFill.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'WebKit/android/WebCoreSupport/autofill/WebAutoFill.h') diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h index 335f9b2..986e1a2 100644 --- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h +++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h @@ -57,8 +57,10 @@ public: void searchDocument(WebCore::Document*); void formFieldFocused(WebCore::HTMLFormControlElement*); - void fillFormFields(int queryId, const string16& value, const string16& label, int uniqueId); + void fillFormFields(int queryId); + void querySuccessful(int queryId, const string16& value, const string16& label, int uniqueId); void fillFormInPage(int queryId, const webkit_glue::FormData& form); + void setWebViewCore(WebViewCore* webViewCore) { mWebViewCore = webViewCore; } private: OwnPtr mFormManager; @@ -69,9 +71,19 @@ private: typedef std::vector > FormList; FormList mForms; - typedef std::map AutoFillQueryMap; - AutoFillQueryMap mQueryMap; + typedef std::map AutoFillQueryFormDataMap; + AutoFillQueryFormDataMap mQueryMap; + + typedef struct { + string16 value; + string16 label; + int uniqueId; + } AutoFillSuggestion; + typedef std::map AutoFillQuerySuggestionMap; + AutoFillQuerySuggestionMap mSuggestionMap; int mQueryId; + + WebViewCore* mWebViewCore; }; } -- cgit v1.1