| Index: content/browser/renderer_host/input/motion_event_android.cc
|
| diff --git a/content/browser/renderer_host/input/motion_event_android.cc b/content/browser/renderer_host/input/motion_event_android.cc
|
| index 3f18f95561b3d650ccc3b3d36bd040f6f12f587f..c152d413a0ca5189cb32e6ce608766faea652a65 100644
|
| --- a/content/browser/renderer_host/input/motion_event_android.cc
|
| +++ b/content/browser/renderer_host/input/motion_event_android.cc
|
| @@ -8,11 +8,13 @@
|
|
|
| #include "base/android/jni_android.h"
|
| #include "base/float_util.h"
|
| +#include "jni/MotionEventUtil_jni.h"
|
| #include "jni/MotionEvent_jni.h"
|
| #include "ui/events/event_constants.h"
|
|
|
| using base::android::AttachCurrentThread;
|
| using namespace JNI_MotionEvent;
|
| +using namespace JNI_MotionEventUtil;
|
|
|
| namespace content {
|
| namespace {
|
| @@ -255,6 +257,22 @@ float MotionEventAndroid::GetOrientation(size_t pointer_index) const {
|
| AttachCurrentThread(), event_.obj(), pointer_index));
|
| }
|
|
|
| +float MotionEventAndroid::GetTilt(size_t pointer_index) const {
|
| + if (!event_.obj())
|
| + return std::numeric_limits<float>::quiet_NaN();
|
| +
|
| + return Java_MotionEventUtil_getAxisValueOrNaN(
|
| + AttachCurrentThread(), event_.obj(), AXIS_TILT, pointer_index);
|
| +}
|
| +
|
| +float MotionEventAndroid::GetTiltDirection(size_t pointer_index) const {
|
| + if (!event_.obj())
|
| + return std::numeric_limits<float>::quiet_NaN();
|
| +
|
| + return Java_MotionEventUtil_getAxisValueOrNaN(
|
| + AttachCurrentThread(), event_.obj(), AXIS_ORIENTATION, pointer_index);
|
| +}
|
| +
|
| float MotionEventAndroid::GetPressure(size_t pointer_index) const {
|
| DCHECK_LT(pointer_index, cached_pointer_count_);
|
| // Note that this early return is a special case exercised only in testing, as
|
| @@ -335,7 +353,8 @@ MotionEventAndroid::CachedPointer MotionEventAndroid::FromAndroidPointer(
|
|
|
| // static
|
| bool MotionEventAndroid::RegisterMotionEventAndroid(JNIEnv* env) {
|
| - return JNI_MotionEvent::RegisterNativesImpl(env);
|
| + return JNI_MotionEvent::RegisterNativesImpl(env)
|
| + && JNI_MotionEventUtil::RegisterNativesImpl(env);
|
| }
|
|
|
| } // namespace content
|
|
|