OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/input/motion_event_android.h" | 5 #include "ui/events/android/motion_event_android.h" |
6 | 6 |
7 #include <android/input.h> | 7 #include <android/input.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
12 #include "jni/MotionEvent_jni.h" | 12 #include "jni/MotionEvent_jni.h" |
13 #include "ui/events/base_event_utils.h" | 13 #include "ui/events/base_event_utils.h" |
14 #include "ui/events/event_constants.h" | 14 #include "ui/events/event_constants.h" |
15 | 15 |
16 using base::android::AttachCurrentThread; | 16 using base::android::AttachCurrentThread; |
17 using namespace JNI_MotionEvent; | 17 using namespace JNI_MotionEvent; |
18 | 18 |
19 namespace content { | 19 namespace ui { |
20 namespace { | 20 namespace { |
21 | 21 |
22 MotionEventAndroid::Action FromAndroidAction(int android_action) { | 22 MotionEventAndroid::Action FromAndroidAction(int android_action) { |
23 switch (android_action) { | 23 switch (android_action) { |
24 case ACTION_DOWN: | 24 case ACTION_DOWN: |
25 return MotionEventAndroid::ACTION_DOWN; | 25 return MotionEventAndroid::ACTION_DOWN; |
26 case ACTION_UP: | 26 case ACTION_UP: |
27 return MotionEventAndroid::ACTION_UP; | 27 return MotionEventAndroid::ACTION_UP; |
28 case ACTION_MOVE: | 28 case ACTION_MOVE: |
29 return MotionEventAndroid::ACTION_MOVE; | 29 return MotionEventAndroid::ACTION_MOVE; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 result.tool_type = FromAndroidToolType(pointer.tool_type); | 353 result.tool_type = FromAndroidToolType(pointer.tool_type); |
354 return result; | 354 return result; |
355 } | 355 } |
356 | 356 |
357 // static | 357 // static |
358 bool MotionEventAndroid::RegisterMotionEventAndroid(JNIEnv* env) { | 358 bool MotionEventAndroid::RegisterMotionEventAndroid(JNIEnv* env) { |
359 return JNI_MotionEvent::RegisterNativesImpl(env); | 359 return JNI_MotionEvent::RegisterNativesImpl(env); |
360 } | 360 } |
361 | 361 |
362 } // namespace content | 362 } // namespace content |
OLD | NEW |