Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: ui/base/touch/touch_device_android.cc

Issue 694533010: [NOT FOR REVIEW] Working cpp enum example (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/touch/touch_device.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « ui/base/touch/touch_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698