diff options
author | Denis Anisimov <denis@vaadin.com> | 2014-09-07 17:39:56 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-09-12 17:11:45 +0000 |
commit | 174dc3530e30b0d3f3af256d5749862509991256 (patch) | |
tree | 403de10671b37d7b51582d93f5055b73fc5d86b8 /shared | |
parent | 55d019853b060f9c7c853d6634179544b325c29a (diff) | |
download | vaadin-framework-174dc3530e30b0d3f3af256d5749862509991256.tar.gz vaadin-framework-174dc3530e30b0d3f3af256d5749862509991256.zip |
WebBrowser.isWindowsPhone() is added (#14425).
Change-Id: Ia279c4da78ca04e0d3727b605e2ce68b99e8cd65
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/com/vaadin/shared/VBrowserDetails.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/VBrowserDetails.java b/shared/src/com/vaadin/shared/VBrowserDetails.java index 81a39cdedc..3c89bdb6bb 100644 --- a/shared/src/com/vaadin/shared/VBrowserDetails.java +++ b/shared/src/com/vaadin/shared/VBrowserDetails.java @@ -42,6 +42,8 @@ public class VBrowserDetails implements Serializable { private boolean isOpera = false; private boolean isIE = false; + private boolean isWindowsPhone; + private OperatingSystem os = OperatingSystem.UNKNOWN; public enum OperatingSystem { @@ -162,6 +164,7 @@ public class VBrowserDetails implements Serializable { // Operating system if (userAgent.contains("windows ")) { os = OperatingSystem.WINDOWS; + isWindowsPhone = userAgent.contains("windows phone"); } else if (userAgent.contains("linux")) { if (userAgent.contains("android")) { os = OperatingSystem.ANDROID; @@ -425,6 +428,15 @@ public class VBrowserDetails implements Serializable { } /** + * Tests if the browser is run on Windows Phone. + * + * @return true if run on Windows Phone, false otherwise + */ + public boolean isWindowsPhone() { + return isWindowsPhone; + } + + /** * Tests if the browser is run on Mac OSX. * * @return true if run on Mac OSX, false otherwise |