Chromium Code Reviews| Index: tools/dom/templates/html/impl/impl_TouchEvent.darttemplate |
| diff --git a/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate b/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate |
| index ea0bef98c19d041c140b3ea30e98b681f5f9a254..3944652d590734e79b42d34880d6ee64acc9a635 100644 |
| --- a/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate |
| +++ b/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate |
| @@ -21,4 +21,24 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| return e; |
| } |
| $!MEMBERS |
| + |
| + /** |
| + * Checks if touch events supported on the current platform. |
| + * |
| + * Note that touch events are only supported if the user is using a touch |
| + * device. |
| + */ |
| + static bool get supported { |
| +$if DART2JS |
| + if (JS('bool', '"ontouchstart" in window')) { |
| + return Event._isTypeSupported('TouchEvent'); |
| + } |
| + return false; |
| +$else |
| + // TODO: add equivalent 'ontouchstart' check for Dartium. |
|
Emily Fortuna
2013/01/29 18:19:21
TOOD(blois): ...
|
| + // Basically, this is a fairly common check and it'd be great if it did not |
| + // throw exceptions. |
| + return Event._isTypeSupported('TouchEvent'); |
| +$endif |
| + } |
| } |