summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/autofill
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-12-01 18:18:33 +0000
committerSteve Block <steveblock@google.com>2010-12-01 18:18:33 +0000
commit08de3e09322b76f64c2b29ff728ec5bc5ac74339 (patch)
treeddaba5f3eb91e138ed3924c789bb69115588f2b2 /WebKit/android/WebCoreSupport/autofill
parent06c18d50c4eb974299c20a241b62c24d02a782ed (diff)
downloadexternal_webkit-08de3e09322b76f64c2b29ff728ec5bc5ac74339.zip
external_webkit-08de3e09322b76f64c2b29ff728ec5bc5ac74339.tar.gz
external_webkit-08de3e09322b76f64c2b29ff728ec5bc5ac74339.tar.bz2
Do more AutoFill steup lazily
Currently, much of the AutoFill setup is done in the WebAutoFill constructor, which is called when the Page is created. This change moves this setup to be done lazily when searchDocument() is called, which is the entry point into the feature. Change-Id: I0d437ed53391b5a7d8d16ec1000dc783c710e564
Diffstat (limited to 'WebKit/android/WebCoreSupport/autofill')
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp15
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.h1
2 files changed, 11 insertions, 5 deletions
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
index 98b250f..73a8460 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
@@ -50,11 +50,17 @@ namespace android
{
WebAutoFill::WebAutoFill()
- : mWebViewCore(0)
+ : mQueryId(1)
+ , mWebViewCore(0)
{
- mFormManager = new FormManager();
- mQueryId = 1;
+}
+
+void WebAutoFill::init()
+{
+ if (mAutoFillManager)
+ return;
+ mFormManager = new FormManager();
AndroidURLRequestContextGetter::Get()->SetURLRequestContext(WebRequestContext::get(false /* isPrivateBrowsing */));
AndroidURLRequestContextGetter::Get()->SetIOThread(WebUrlLoaderClient::ioThread());
mTabContents = new TabContents();
@@ -82,8 +88,7 @@ void WebAutoFill::searchDocument(WebCore::Frame* frame)
if (!enabled())
return;
- if (!mFormManager)
- return;
+ init();
mQueryMap.clear();
mUniqueIdMap.clear();
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
index 71c9a96..422129f 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
@@ -71,6 +71,7 @@ public:
bool updateProfileLabel();
private:
+ void init();
void setEmptyProfile();
OwnPtr<FormManager> mFormManager;