diff options
Diffstat (limited to 'WebKit/android')
-rw-r--r-- | WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp | 15 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/autofill/WebAutoFill.h | 1 |
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; |