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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/MotionEventUtil.java

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code (event_sender.cc) Created 5 years, 9 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
« no previous file with comments | « content/content_jni.gypi ('k') | content/renderer/pepper/event_conversion.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/MotionEventUtil.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/MotionEventUtil.java b/content/public/android/java/src/org/chromium/content/browser/MotionEventUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..48ecb1f3d2ca3ba5b355f3b89715e348deca9605
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/MotionEventUtil.java
@@ -0,0 +1,28 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser;
+
+import android.view.InputDevice;
+import android.view.MotionEvent;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+/**
+ * TODO
+ */
+@JNINamespace("JNI_MotionEventUtil")
+final class MotionEventUtil {
+ /**
+ */
+ @CalledByNative
+ public static float getAxisValueOrNaN(MotionEvent event, int axis, int pointerIndex) {
+ InputDevice device = event.getDevice();
+ InputDevice.MotionRange range = device.getMotionRange(axis);
+ if (range == null || range.getRange() == 0.0)
+ return Float.NaN;
+ return event.getAxisValue(axis, pointerIndex);
+ }
+}
« no previous file with comments | « content/content_jni.gypi ('k') | content/renderer/pepper/event_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698