summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 00:01:38 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 00:01:38 +0000
commit7e0492d70168d38ab66e3719415b283828587a9f (patch)
treed160c131a8d0a6cd2c32679a91104d82186ba66b
parent7e5d5f78648213b56eeb2137a3ae9432bfd09e2e (diff)
downloadchromium_src-7e0492d70168d38ab66e3719415b283828587a9f.zip
chromium_src-7e0492d70168d38ab66e3719415b283828587a9f.tar.gz
chromium_src-7e0492d70168d38ab66e3719415b283828587a9f.tar.bz2
Landing r56438 to the M6 branch.
Original review: http://codereview.chromium.org/3158017 Every time a new autofill suggestion was received we would hide the autofill popup before showing a new one. This causes it to flash every time the user type a new key (as we get new suggestions for each key stroke). It is safe to hide the autofill only when there are no suggestions. If there are suggestions, the WebKit side takes care of resizing and potentially hiding the popup if necessary. BUG=49980 TEST=Trigger the AutoFill/Autocomplete popup. As you type characters in the text input, the popup should not flash. Test that it does not flash either when you press backspace. TBR=kerz Review URL: http://codereview.chromium.org/3165031 git-svn-id: svn://svn.chromium.org/chrome/branches/472/src@56459 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/autofill_helper.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/renderer/autofill_helper.cc b/chrome/renderer/autofill_helper.cc
index 77a7aba..eaf3b2e 100644
--- a/chrome/renderer/autofill_helper.cc
+++ b/chrome/renderer/autofill_helper.cc
@@ -71,12 +71,11 @@ void AutoFillHelper::SuggestionsReceived(int query_id,
if (!web_view || query_id != autofill_query_id_)
return;
- // Any popup currently showing is now obsolete.
- web_view->hidePopups();
-
- // No suggestions: nothing to do.
- if (values.empty())
+ if (values.empty()) {
+ // No suggestions, any popup currently showing is obsolete.
+ web_view->hidePopups();
return;
+ }
std::vector<string16> v(values);
std::vector<string16> l(labels);