[go: nahoru, domu]

Support double tap to zoom in tablet-mode pages

This CL adds support for double taps to zoom pages that
are whitelisted to run in tablet mode (whose webkit prefs
were updated to have a mobile-like behavior). All other
webpages and system UI components should not be affected.

Summary:
- GestureDetector is informed whether it should process
  double tap events by the GestureListenerImpl.
- GestureListenerImpl asks its GestureProviderClient
  whether double tap events should be processed.
- GestureProviderAura as a GestureProviderClient asks
  its GestureConsumer if double tap events should be
  processed.
- GestureConsumers can specify if they can handle double
  tap events.
- aura::Window as a GestureConsumer asks its WindowDelegate
  if they can handle double tap events.
- RenderWidgetHostViewAura as a WindowDelegate checks its
  RenderViewHost's webkit preferences to see if double tap
  to zoom is enabled.
- On switching to tablet mode, if the webpage should have
  a mobile-like behavior, its webkit preferences are updated
  to set double tap to zoom enabled.

BUG=822455
TEST=browser_tests --gtest_filter=TabletModePageBehaviorTest.*
TEST=events_unittests --gtest_filter=GestureProviderTest*

Change-Id: Idfeb3af54af8e006bc71812135387dd4866e9c72
Reviewed-on: https://chromium-review.googlesource.com/1045488
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562686}
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index 5c31061d..426d1f82 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -138,6 +138,7 @@
     "scoped_simple_keyboard_hook.cc",
     "scoped_window_targeter.cc",
     "window.cc",
+    "window_delegate.cc",
     "window_event_dispatcher.cc",
     "window_observer.cc",
     "window_occlusion_tracker.cc",