/** * Tests if the browser is run on Android. * * @return true if run on Android false if the user is not using Android or * if no information on the browser is present */ public boolean isAndroid() { return browserDetails.isAndroid(); }
/** * Gets the major version of the browser the user is using. * * <p> * Note that Internet Explorer in IE7 compatibility mode might return 8 in * some cases even though it should return 7. * </p> * * @return The major version of the browser or -1 if not known. */ public int getBrowserMajorVersion() { if (browserDetails == null) { return -1; } return browserDetails.getBrowserMajorVersion(); }
/** * Gets the minor version of the browser the user is using. * * @see #getBrowserMajorVersion() * * @return The minor version of the browser or -1 if not known. */ public int getBrowserMinorVersion() { if (browserDetails == null) { return -1; } return browserDetails.getBrowserMinorVersion(); }
/** * @return true if the Android version is older than 4.2, in which case the * HTML5 date field is not very useful. */ private boolean isOldAndroid() { VBrowserDetails details = new VBrowserDetails( BrowserInfo.getBrowserString()); return details.isAndroid() && (details.getOperatingSystemMajorVersion() < 4 || details .getOperatingSystemMinorVersion() < 2); }
/** * For internal use by VaadinServlet/VaadinPortlet only. Updates all * properties in the class according to the given information. * * @param request * the Vaadin request to read the information from */ public void updateRequestDetails(VaadinRequest request) { locale = request.getLocale(); address = request.getRemoteAddr(); secureConnection = request.isSecure(); // Headers are case insensitive according to the specification but are // case sensitive in Weblogic portal... String agent = request.getHeader("User-Agent"); if (agent != null) { browserApplication = agent; browserDetails = new VBrowserDetails(agent); } if (request.getParameter("v-sw") != null) { updateClientSideDetails(request.getParameter("v-sw"), request.getParameter("v-sh"), request.getParameter("v-tzo"), request.getParameter("v-rtzo"), request.getParameter("v-dstd"), request.getParameter("v-dston"), request.getParameter("v-tzid"), request.getParameter("v-curdate"), request.getParameter("v-td") != null); } }
/** * Tests whether the user is using Chrome. * * @return true if the user is using Chrome, false if the user is not using * Chrome or if no information on the browser is present */ public boolean isChrome() { if (browserDetails == null) { return false; } return browserDetails.isChrome(); }
/** * Tests whether the user's browser is Chrome Frame capable. * * @return true if the user can use Chrome Frame, false if the user can not * or if no information on the browser is present */ public boolean isChromeFrameCapable() { if (browserDetails == null) { return false; } return browserDetails.isChromeFrameCapable(); }
/** * Tests whether the user is using Chrome Frame. * * @return true if the user is using Chrome Frame, false if the user is not * using Chrome or if no information on the browser is present */ public boolean isChromeFrame() { if (browserDetails == null) { return false; } return browserDetails.isChromeFrame(); }
/** * Gets the complete browser version as string. The version is given by the * browser through the user agent string and usually consists of * dot-separated numbers. Note that the string may contain characters other * than dots and digits. * * @return the complete browser version or {@code null} if unknown * @since 8.4 */ public String getBrowserVersion() { return browserDetails != null ? browserDetails.getBrowserVersion() : null; }