[Android] Show autofill popup after animation.
commitf7ebd883699112506893fc0500a65c5a10e563ec
authorrouslan <rouslan@chromium.org>
Thu, 22 Jan 2015 01:54:14 +0000 (21 17:54 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 22 Jan 2015 01:55:40 +0000 (22 01:55 +0000)
tree9e19faae4ecf97f42adc6d2620b0903ab2837f74
parent196692c000558976906e11c7d184301c55aada20
[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}
40 files changed:
android_webview/browser/hardware_renderer.h
cc/test/fake_layer_tree_host_client.h
cc/test/fake_layer_tree_host_impl_client.h
cc/test/layer_tree_test.cc
cc/trees/layer_tree_host.cc
cc/trees/layer_tree_host.h
cc/trees/layer_tree_host_client.h
cc/trees/layer_tree_host_impl.cc
cc/trees/layer_tree_host_impl.h
cc/trees/layer_tree_host_impl_unittest.cc
cc/trees/layer_tree_host_unittest_no_message_loop.cc
cc/trees/single_thread_proxy.cc
cc/trees/single_thread_proxy.h
cc/trees/thread_proxy.cc
cc/trees/thread_proxy.h
chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java [new file with mode: 0644]
chrome/renderer/autofill/page_click_tracker_browsertest.cc
chrome/renderer/autofill/password_generation_agent_browsertest.cc
components/autofill/content/renderer/autofill_agent.cc
components/autofill/content/renderer/autofill_agent.h
components/autofill/content/renderer/form_autofill_util.cc
components/autofill/content/renderer/form_autofill_util.h
components/autofill/content/renderer/page_click_tracker.cc
components/autofill/content/renderer/page_click_tracker.h
content/browser/renderer_host/compositor_impl_android.h
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java
content/public/renderer/render_view_observer.h
content/public/test/render_view_test.cc
content/public/test/render_view_test.h
content/renderer/gpu/render_widget_compositor.cc
content/renderer/gpu/render_widget_compositor.h
content/renderer/render_view_impl.cc
content/renderer/render_view_impl.h
content/renderer/render_widget.cc
content/renderer/render_widget.h
content/test/web_layer_tree_view_impl_for_testing.h
mojo/services/html_viewer/weblayertreeview_impl.h
ui/compositor/compositor.h