| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/base/touch/touch_device.h" | 5 #include "ui/base/touch/touch_device.h" |
| 6 | 6 |
| 7 #include "jni/TouchDevice_jni.h" | 7 #include "jni/TouchDevice_jni.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| 11 bool IsTouchDevicePresent() { | 11 bool IsTouchDevicePresent() { |
| 12 return true; | 12 return true; |
| 13 } | 13 } |
| 14 | 14 |
| 15 int MaxTouchPoints() { | 15 int MaxTouchPoints() { |
| 16 JNIEnv* env = base::android::AttachCurrentThread(); | 16 JNIEnv* env = base::android::AttachCurrentThread(); |
| 17 jobject context = base::android::GetApplicationContext(); | 17 jobject context = base::android::GetApplicationContext(); |
| 18 jint max_touch_points = Java_TouchDevice_maxTouchPoints(env, context); | 18 jint max_touch_points = Java_TouchDevice_maxTouchPoints(env, context); |
| 19 return static_cast<int>(max_touch_points); | 19 return static_cast<int>(max_touch_points); |
| 20 } | 20 } |
| 21 | 21 |
| 22 int AvailablePointerTypes() { |
| 23 JNIEnv* env = base::android::AttachCurrentThread(); |
| 24 jobject context = base::android::GetApplicationContext(); |
| 25 jint available_pointer_types = |
| 26 Java_TouchDevice_availablePointerTypes(env, context); |
| 27 return static_cast<int>(available_pointer_types); |
| 28 } |
| 29 |
| 30 PointerType PrimaryPointerType() { |
| 31 return PointerTypeCoarse; |
| 32 } |
| 33 |
| 34 int AvailableHoverTypes() { |
| 35 return 0; |
| 36 } |
| 37 |
| 38 HoverType PrimaryHoverType() { |
| 39 return HoverTypeNone; |
| 40 } |
| 41 |
| 22 bool RegisterTouchDeviceAndroid(JNIEnv* env) { | 42 bool RegisterTouchDeviceAndroid(JNIEnv* env) { |
| 23 return RegisterNativesImpl(env); | 43 return RegisterNativesImpl(env); |
| 24 } | 44 } |
| 25 | 45 |
| 26 } // namespace ui | 46 } // namespace ui |
| OLD | NEW |