Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(829)

Unified Diff: content/browser/renderer_host/input/touch_emulator.cc

Issue 859973003: Touch emulator: enables double tap support for pages similar to Chrome on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: frame_metadata_util Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/touch_emulator.cc
diff --git a/content/browser/renderer_host/input/touch_emulator.cc b/content/browser/renderer_host/input/touch_emulator.cc
index a7010e339fffd4088cd808163d3e0836e55863ff..ec6057b8ce2fe02896e090aa1f8d122998cd703a 100644
--- a/content/browser/renderer_host/input/touch_emulator.cc
+++ b/content/browser/renderer_host/input/touch_emulator.cc
@@ -47,6 +47,7 @@ TouchEmulator::TouchEmulator(TouchEmulatorClient* client)
: client_(client),
gesture_provider_config_type_(
ui::GestureProviderConfigType::CURRENT_PLATFORM),
+ double_tap_enabled_(true),
emulated_stream_active_sequence_count_(0),
native_stream_active_sequence_count_(0) {
DCHECK(client_);
@@ -92,9 +93,7 @@ void TouchEmulator::Enable(ui::GestureProviderConfigType config_type) {
GetEmulatorGestureProviderConfig(config_type), this));
// TODO(dgozman): Use synthetic secondary touch to support multi-touch.
gesture_provider_->SetMultiTouchZoomSupportEnabled(false);
- // TODO(dgozman): Enable double tap if requested by the renderer.
- // TODO(dgozman): Don't break double-tap-based pinch with shift handling.
- gesture_provider_->SetDoubleTapSupportForPlatformEnabled(false);
+ gesture_provider_->SetDoubleTapSupportForPageEnabled(double_tap_enabled_);
}
UpdateCursor();
}
@@ -109,6 +108,12 @@ void TouchEmulator::Disable() {
ResetState();
}
+void TouchEmulator::SetDoubleTapSupportForPageEnabled(bool enabled) {
+ double_tap_enabled_ = enabled;
+ if (gesture_provider_)
+ gesture_provider_->SetDoubleTapSupportForPageEnabled(enabled);
+}
+
gfx::SizeF TouchEmulator::InitCursorFromResource(
WebCursor* cursor, float scale, int resource_id) {
gfx::Image& cursor_image =
« no previous file with comments | « content/browser/renderer_host/input/touch_emulator.h ('k') | content/browser/renderer_host/input/touch_emulator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698