[Android] Show autofill popup after animation.
The renderer shows autofill popups immediately upon click or focus
change. If the browser shows an IME (virtual keyboard), then it can zoom
and scroll the webpage, which will hide the popup. This behavior causes
a "flash" of autofill popup on platforms with IME (ChromeOS, Windows 8,
and Android). This patch mostly fixes Android and paves the way for
fixing Windows 8 and ChromeOS.
The fix involves roughly 5 parts.
1) If the platform does not support a virtual keyboard (Mac, Linux,
Windows 7), the renderer shows the autofill popup immediately.
2) If a virtual keyboard is supported, but disabled (ChromeOS without a
virtual keyboard and Android with a hardware keyboard), then the
browser notifies the renderer that the autofill popup can be shown.
3) If the virtual keyboard is already showing, then the browser notifies
the renderer that the autofill popup can be shown.
A corner case is the Android keyboard, which can change its own
size when switching between input fields, thus resizing the webpage
and hiding the autofill popup. The mitigation is to hide the
autofill popup only if the input field moves due to the
resize. This mitigation is not in this patch.
4) If the input field is already in a good position (visible on screen
and legible size) after the keyboard is shown, then there will be no
zoom and scroll animations. Then the renderer can show the autofill
popup.
5) If the input field is zooming and scrolling into a good position
(visible on screen and legible size) after the keyboard is shown,
then the renderer waits until the compositor notifies it that the
this animation has finished. Then the renderer can show the autofill
popup.
BUG=430318, 440161
Review URL: https://codereview.chromium.org/
715733002
Cr-Commit-Position: refs/heads/master@{#312521}