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

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: Moved to dip_util, renamed to IsMobileOptimizedFrame 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 8592bd2031c3f9dd0a0dadde0f8ef4717f91cb96..be24b9d2c2c377acd7422788dcef575cd86a9cee 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_);
jdduke (slow) 2015/01/22 16:28:27 Hmm, is it intentional that we could support doubl
dgozman 2015/01/22 17:04:37 I thought that config does already contain SetDoub
jdduke (slow) 2015/01/22 17:09:36 Do you want to do that in this patch? Or I can qui
}
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/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698