summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebSettings.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-12-02 15:38:31 +0000
committerBen Murdoch <benm@google.com>2010-12-06 12:10:01 +0000
commit95a009844dd8e8b8d3d92d7ef14c31bd48468423 (patch)
tree5f91e590376116f9b3fee9ce118430d2adc2dbf9 /WebKit/android/jni/WebSettings.cpp
parent2e99fe47543f09c4d9e797beff199b62e0c5c2a3 (diff)
downloadexternal_webkit-95a009844dd8e8b8d3d92d7ef14c31bd48468423.zip
external_webkit-95a009844dd8e8b8d3d92d7ef14c31bd48468423.tar.gz
external_webkit-95a009844dd8e8b8d3d92d7ef14c31bd48468423.tar.bz2
Refactor AutoFill so it runs lazily.
This CL refactors the AutoFill code so that we only search for forms when we need to, i.e. the user has focused a form field. This helps page load times. We also re-search the document for forms if the dom version number has changed. These changes fix a bug where a crash occurs if the form is focused before the page has finished loading. We also move the callsite of formFieldFocused so that it only occurs when the IME is requested which is a more appropriate place called less frequently than it's current callsite in EditorClientAndroid. Bug: 3243567 Change-Id: I04fe13944d3f8248197d71a0e58c21f01c4abdd0
Diffstat (limited to 'WebKit/android/jni/WebSettings.cpp')
-rw-r--r--WebKit/android/jni/WebSettings.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp
index 75f42b3..dc3723d 100644
--- a/WebKit/android/jni/WebSettings.cpp
+++ b/WebKit/android/jni/WebSettings.cpp
@@ -504,17 +504,11 @@ public:
// (see chrome/browser/autofill/autofill_manager.cc:405). This
// setting should probably be synced into Chromium also.
- // If we toggle from disabled to enabled, then re search the document
- // for forms.
- bool oldAutoFillSetting = s->autoFillEnabled();
s->setAutoFillEnabled(flag);
- EditorClientAndroid* editorC = static_cast<EditorClientAndroid*>(pFrame->page()->editorClient());
- WebAutoFill* webAutoFill = editorC->getAutoFill();
- if (!oldAutoFillSetting && flag)
- webAutoFill->searchDocument(pFrame);
-
if (flag) {
+ EditorClientAndroid* editorC = static_cast<EditorClientAndroid*>(pFrame->page()->editorClient());
+ WebAutoFill* webAutoFill = editorC->getAutoFill();
// Set the active AutoFillProfile data.
jobject autoFillProfile = env->GetObjectField(obj, gFieldIds->mAutoFillProfile);
if (autoFillProfile)