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

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

Issue 95153002: Make touch-based synthetic gesture take touch slop into account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: undo pinch refactoring; get device scale factor from gfx::Screen Created 7 years 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/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..33989d36b62e416298f44b233c02cb730d861738 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target_android.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_android.cc
@@ -5,8 +5,11 @@
#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/common/android/view_configuration.h"
#include "jni/TouchEventSynthesizer_jni.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
+#include "ui/gfx/screen.h"
using blink::WebTouchEvent;
@@ -80,4 +83,11 @@ bool SyntheticGestureTargetAndroid::SupportsSyntheticGestureSourceType(
return gesture_source_type == SyntheticGestureParams::TOUCH_INPUT;
}
+int SyntheticGestureTargetAndroid::GetTouchSlopInDips() const {
+ float device_scale_factor =
+ gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor();
+ return
jdduke (slow) 2013/12/02 16:29:43 Nit: I think this can fit on one line?
Dominik Grewe 2013/12/02 16:42:26 Done.
+ ViewConfiguration::GetTouchSlopInPixels() / device_scale_factor;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698