Index: content/browser/renderer_host/input/synthetic_gesture_target_android.cc |
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_android.cc b/content/browser/renderer_host/input/synthetic_gesture_target_android.cc |
index acaee85dd949a65891179f14b98806fb53f7c1c5..8c8c9ed53ea5b2b68c7b92d283652fc78065e118 100644 |
--- a/content/browser/renderer_host/input/synthetic_gesture_target_android.cc |
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_android.cc |
@@ -5,6 +5,9 @@ |
#include "content/browser/renderer_host/input/synthetic_gesture_target_android.h" |
#include "content/browser/android/content_view_core_impl.h" |
+#include "content/browser/renderer_host/render_widget_host_impl.h" |
+#include "content/browser/renderer_host/render_widget_host_view_android.h" |
+#include "content/common/android/view_configuration.h" |
#include "jni/TouchEventSynthesizer_jni.h" |
#include "third_party/WebKit/public/web/WebInputEvent.h" |
@@ -80,4 +83,15 @@ bool SyntheticGestureTargetAndroid::SupportsSyntheticGestureSourceType( |
return gesture_source_type == SyntheticGestureParams::TOUCH_INPUT; |
} |
+int SyntheticGestureTargetAndroid::GetTouchSlopInDips() const { |
+ // Option 1: Get touch slop in DIPs directly (deprecated). |
+ //return ViewConfiguration::GetTouchSlopInDips(); |
+ |
+ // Option 2: Get touch slop in pixels and convert to DIPs |
+ RenderWidgetHostViewAndroid* view = static_cast<RenderWidgetHostViewAndroid*>( |
+ render_widget_host()->GetView()); |
+ return |
+ ViewConfiguration::GetTouchSlopInPixels() / view->GetDeviceScaleFactor(); |
jdduke (slow)
2013/12/02 15:51:40
You can use the following to save yourself some tr
Dominik Grewe
2013/12/02 16:18:54
Nice! Wasn't aware of that.
|
+} |
+ |
} // namespace content |