}
private VBrowserDetails browserDetails;
+ private boolean touchDevice;
private BrowserInfo() {
browserDetails = new VBrowserDetails(getBrowserString());
browserDetails.setIEMode(documentMode);
}
}
+ touchDevice = detectTouchDevice();
}
+ private native boolean detectTouchDevice()
+ /*-{
+ try { document.createEvent("TouchEvent");return true;} catch(e){return false;};
+ }-*/;
+
private native int getIEDocumentMode()
/*-{
var mode = $wnd.document.documentMode;
}-*/;
+ /**
+ * @return true if the browser runs on a touch based device.
+ */
+ public boolean isTouchDevice() {
+ return touchDevice;
+ }
+
}