diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-16 00:05:15 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-16 00:05:15 +0000 |
commit | 01899c12fdad06f0e12667871be5ac99624256d8 (patch) | |
tree | c98b6c59915dcb1cdc9ead4fafb828df08f4a12e /webkit/glue/editor_client_impl.cc | |
parent | c1bcb90272edd39e67f85877b58da4f28fef055e (diff) | |
download | chromium_src-01899c12fdad06f0e12667871be5ac99624256d8.zip chromium_src-01899c12fdad06f0e12667871be5ac99624256d8.tar.gz chromium_src-01899c12fdad06f0e12667871be5ac99624256d8.tar.bz2 |
Changes to the autofill popup:
- we now reuse the existing popup if there is one (instead of creating a new on with each key stoke), this prevents the flickering we used to see.
- we don't hide the popup on every key stroke, instead we rely on the client editor telling us the field is not being edited anymore.
TEST=Enter some text in a form's text field several times, the autofill should show and not flicker.
BUG=5258
Review URL: http://codereview.chromium.org/14100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7017 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/editor_client_impl.cc')
-rw-r--r-- | webkit/glue/editor_client_impl.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/glue/editor_client_impl.cc b/webkit/glue/editor_client_impl.cc index e1b3e1e..4daa74d 100644 --- a/webkit/glue/editor_client_impl.cc +++ b/webkit/glue/editor_client_impl.cc @@ -644,6 +644,9 @@ void EditorClientImpl::textFieldDidEndEditing(WebCore::Element*) { // Cancel any pending DoAutofill calls. autofill_factory_.RevokeAll(); + + // Hide any showing popup. + web_view_->HideAutoCompletePopup(); } void EditorClientImpl::textDidChangeInTextField(WebCore::Element* element) { @@ -687,8 +690,10 @@ void EditorClientImpl::DoAutofill(WebCore::HTMLInputElement* input_element, bool caret_at_end = input_element->selectionStart() == input_element->selectionEnd() && input_element->selectionEnd() == static_cast<int>(value.length()); - if (value.empty() || !caret_at_end) + if (value.empty() || !caret_at_end) { + web_view_->HideAutoCompletePopup(); return; + } // First let's see if there is a password listener for that element. WebFrameImpl* webframe = |