summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webview_impl.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 22:13:39 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 22:13:39 +0000
commita7c613fd829a737e5089efd9aa7fb3ac637f7bcd (patch)
treee301a955615b98f533b4f90e940f9e3a7cd0294c /webkit/glue/webview_impl.cc
parent623ceae37731500814323738f8208d5742ca92b3 (diff)
downloadchromium_src-a7c613fd829a737e5089efd9aa7fb3ac637f7bcd.zip
chromium_src-a7c613fd829a737e5089efd9aa7fb3ac637f7bcd.tar.gz
chromium_src-a7c613fd829a737e5089efd9aa7fb3ac637f7bcd.tar.bz2
Deleting the item from a form autofill popup with just one item would leave an empty autofill popup (not very visible but capturing focus).
BUG=9267 TEST=In a form, bring-up an autofill popup with only one suggestion. Select the suggestion an press delete. The popup should disappear and pressing tab should move the focus to next element in the page. Review URL: http://codereview.chromium.org/55040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webview_impl.cc')
-rw-r--r--webkit/glue/webview_impl.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 2c591ed..c09a174 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -1777,6 +1777,13 @@ void WebViewImpl::HideAutofillPopup() {
void WebViewImpl::RefreshAutofillPopup() {
DCHECK(autocomplete_popup_showing_);
+
+ // Hide the popup if it has become empty.
+ if (autocomplete_popup_client_->listSize() == 0) {
+ HideAutoCompletePopup();
+ return;
+ }
+
IntRect old_bounds = autocomplete_popup_->boundsRect();
autocomplete_popup_->refresh();
IntRect new_bounds = autocomplete_popup_->boundsRect();