| 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);
|
| + }
|
| +}
|
|
|