Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_BASE_TOUCH_TOUCH_DEVICE_H_ | 5 #ifndef UI_BASE_TOUCH_TOUCH_DEVICE_H_ |
| 6 #define UI_BASE_TOUCH_TOUCH_DEVICE_H_ | 6 #define UI_BASE_TOUCH_TOUCH_DEVICE_H_ |
| 7 | 7 |
| 8 #include "ui/base/ui_base_export.h" | 8 #include "ui/base/ui_base_export.h" |
| 9 | 9 |
| 10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
| 11 #include <jni.h> | 11 #include <jni.h> |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 // Returns true if a touch device is available. | 17 // Returns true if a touch device is available. |
| 18 UI_BASE_EXPORT bool IsTouchDevicePresent(); | 18 UI_BASE_EXPORT bool IsTouchDevicePresent(); |
| 19 | 19 |
| 20 // Returns the maximum number of simultaneous touch contacts supported | 20 // Returns the maximum number of simultaneous touch contacts supported |
| 21 // by the device. In the case of devices with multiple digitizers (e.g. | 21 // by the device. In the case of devices with multiple digitizers (e.g. |
| 22 // multiple touchscreens), the value MUST be the maximum of the set of | 22 // multiple touchscreens), the value MUST be the maximum of the set of |
| 23 // maximum supported contacts by each individual digitizer. | 23 // maximum supported contacts by each individual digitizer. |
| 24 // For example, suppose a device has 3 touchscreens, which support 2, 5, | 24 // For example, suppose a device has 3 touchscreens, which support 2, 5, |
| 25 // and 10 simultaneous touch contacts, respectively. This returns 10. | 25 // and 10 simultaneous touch contacts, respectively. This returns 10. |
| 26 // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints | 26 // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints |
| 27 UI_BASE_EXPORT int MaxTouchPoints(); | 27 UI_BASE_EXPORT int MaxTouchPoints(); |
| 28 | 28 |
| 29 // Bit field values indicating what kind of pointer types are available. These | |
| 30 // enum must match content::PointerType enums. | |
| 31 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.base | |
| 32 enum PointerType { | |
| 33 PointerTypeNone = 1, | |
|
jdduke (slow)
2014/10/31 15:51:44
Why start with 1 for None? Also, the typical way o
mustaq
2014/10/31 16:58:20
Short answer: I followed the blink-side (WebSettin
bokan
2014/11/03 14:28:11
Actually, this isn't to do with an "unknown" value
mustaq
2014/11/03 17:11:38
Thanks for the clarification. Will keep the 1-base
| |
| 34 PointerTypeCoarse = 2, | |
| 35 PointerTypeFine = 4 | |
| 36 }; | |
| 37 | |
| 38 // Bit field values indicating what kind of pointer types are available. These | |
| 39 // enums must match content::HoverType enums. | |
| 40 enum HoverType { | |
| 41 HoverTypeNone = 1, | |
|
jdduke (slow)
2014/10/31 15:51:44
Why can't we just use the ui::PointerType/ui::Hove
mustaq
2014/10/31 16:58:20
Hmm, didn't think this way. I instead considered u
| |
| 42 HoverTypeOnDemand = 2, | |
| 43 HoverTypeHover = 4 | |
| 44 }; | |
| 45 | |
| 46 UI_BASE_EXPORT int AvailablePointerTypes(); | |
| 47 UI_BASE_EXPORT PointerType PrimaryPointerType(); | |
| 48 UI_BASE_EXPORT int AvailableHoverTypes(); | |
| 49 UI_BASE_EXPORT HoverType PrimaryHoverType(); | |
| 50 | |
| 29 #if defined(OS_ANDROID) | 51 #if defined(OS_ANDROID) |
| 30 bool RegisterTouchDeviceAndroid(JNIEnv* env); | 52 bool RegisterTouchDeviceAndroid(JNIEnv* env); |
| 31 #endif | 53 #endif |
| 32 | 54 |
| 33 } // namespace ui | 55 } // namespace ui |
| 34 | 56 |
| 35 #endif // UI_BASE_TOUCH_TOUCH_DEVICE_H_ | 57 #endif // UI_BASE_TOUCH_TOUCH_DEVICE_H_ |
| OLD | NEW |