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 "content/browser/renderer_host/input/motion_event_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "jni/MotionEvent_jni.h" | 8 #include "jni/MotionEvent_jni.h" |
9 | 9 |
10 using base::android::AttachCurrentThread; | 10 using base::android::AttachCurrentThread; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 MotionEventAndroid::ToolType FromAndroidToolType(int android_tool_type) { | 57 MotionEventAndroid::ToolType FromAndroidToolType(int android_tool_type) { |
58 switch (android_tool_type) { | 58 switch (android_tool_type) { |
59 case TOOL_TYPE_UNKNOWN: | 59 case TOOL_TYPE_UNKNOWN: |
60 return MotionEventAndroid::TOOL_TYPE_UNKNOWN; | 60 return MotionEventAndroid::TOOL_TYPE_UNKNOWN; |
61 case TOOL_TYPE_FINGER: | 61 case TOOL_TYPE_FINGER: |
62 return MotionEventAndroid::TOOL_TYPE_FINGER; | 62 return MotionEventAndroid::TOOL_TYPE_FINGER; |
63 case TOOL_TYPE_STYLUS: | 63 case TOOL_TYPE_STYLUS: |
64 return MotionEventAndroid::TOOL_TYPE_STYLUS; | 64 return MotionEventAndroid::TOOL_TYPE_STYLUS; |
65 case TOOL_TYPE_MOUSE: | 65 case TOOL_TYPE_MOUSE: |
66 return MotionEventAndroid::TOOL_TYPE_MOUSE; | 66 return MotionEventAndroid::TOOL_TYPE_MOUSE; |
| 67 case TOOL_TYPE_ERASER: |
| 68 return MotionEventAndroid::TOOL_TYPE_ERASER; |
67 default: | 69 default: |
68 NOTREACHED() << "Invalid Android MotionEvent tool type: " | 70 NOTREACHED() << "Invalid Android MotionEvent tool type: " |
69 << android_tool_type; | 71 << android_tool_type; |
70 }; | 72 }; |
71 return MotionEventAndroid::TOOL_TYPE_UNKNOWN; | 73 return MotionEventAndroid::TOOL_TYPE_UNKNOWN; |
72 } | 74 } |
73 | 75 |
74 int FromAndroidButtonState(int button_state) { | 76 int FromAndroidButtonState(int button_state) { |
75 int result = 0; | 77 int result = 0; |
76 if ((button_state & BUTTON_BACK) != 0) | 78 if ((button_state & BUTTON_BACK) != 0) |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 return Java_MotionEvent_obtainAVME_J_J_I_F_F_I(AttachCurrentThread(), | 381 return Java_MotionEvent_obtainAVME_J_J_I_F_F_I(AttachCurrentThread(), |
380 ToAndroidTime(down_time), | 382 ToAndroidTime(down_time), |
381 ToAndroidTime(event_time), | 383 ToAndroidTime(event_time), |
382 ToAndroidAction(action), | 384 ToAndroidAction(action), |
383 x_pixels, | 385 x_pixels, |
384 y_pixels, | 386 y_pixels, |
385 0); | 387 0); |
386 } | 388 } |
387 | 389 |
388 } // namespace content | 390 } // namespace content |
OLD | NEW |