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

Side by Side Diff: ui/android/java/src/org/chromium/ui/base/TouchDevice.java

Issue 186943002: Plumbing maxTouchPoints for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
Ted C 2014/03/05 21:14:26 2014
bokan 2014/03/05 22:49:20 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.ui.base;
6
7 import android.content.Context;
8 import android.content.pm.PackageManager;
9
10 import org.chromium.base.CalledByNative;
11 import org.chromium.base.JNINamespace;
12
13 /**
14 * Simple proxy to let us query the touch device from C++
15 */
16 @JNINamespace("ui")
17 public class TouchDevice {
Ted C 2014/03/05 21:14:26 since this only contains statics, maybe make a pri
bokan 2014/03/05 22:49:20 Done.
18 /**
19 * Returns the number of supported touch points.
20 *
21 * @return Maximum supported touch points.
22 */
23 @CalledByNative
24 private static int maxTouchPoints(Context context) {
25 // Android only tells us if the device belongs to a "Touchscreen Class"
26 // which only guarantees a minimum number of touch points. Be
27 // conservative and return the minimum, checking membership from the
28 // highest class down.
29 if (context.getPackageManager().hasSystemFeature(
30 PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND)) {
Ted C 2014/03/05 21:14:26 Ha! Best constant name ever.
31 return 5;
32 } else if (context.getPackageManager().hasSystemFeature(
33 PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT)) {
34 return 2;
35 } else if (context.getPackageManager().hasSystemFeature(
36 PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)) {
37 return 2;
38 } else if (context.getPackageManager().hasSystemFeature(
39 PackageManager.FEATURE_TOUCHSCREEN)) {
40 return 1;
41 } else {
42 return 0;
43 }
44 }
45 }
OLDNEW
« no previous file with comments | « no previous file | ui/base/android/ui_base_jni_registrar.cc » ('j') | ui/base/touch/touch_device_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698