diff options
author | Artur Signell <artur.signell@itmill.com> | 2012-04-26 13:11:23 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2012-04-26 13:11:23 +0000 |
commit | 44a1893f97cee51124970805f4b140f89716aa6d (patch) | |
tree | 5e57c46ac5a8700f3964aba895fabc70687fe3c1 /src/com/vaadin | |
parent | 3d61fc01830342f2a8bba628e754648ac6370a0c (diff) | |
download | vaadin-framework-44a1893f97cee51124970805f4b140f89716aa6d.tar.gz vaadin-framework-44a1893f97cee51124970805f4b140f89716aa6d.zip |
Joined MobileOS and OS so only one operating system is reported (#7911)
svn changeset:23641/svn branch:6.8
Diffstat (limited to 'src/com/vaadin')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/BrowserInfo.java | 25 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/VBrowserDetails.java | 21 |
2 files changed, 16 insertions, 30 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java index a7edee5f32..a2e5bffe39 100644 --- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java +++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java @@ -30,9 +30,8 @@ public class BrowserInfo { private static final String OS_WINDOWS = "win"; private static final String OS_LINUX = "lin"; private static final String OS_MACOSX = "mac"; - - private static final String MOS_ANDROID = "android"; - private static final String MOS_IOS = "ios"; + private static final String OS_ANDROID = "android"; + private static final String OS_IOS = "ios"; private static BrowserInfo instance; @@ -173,17 +172,17 @@ public class BrowserInfo { cssClass = cssClass + " " + prefix + osClass; } - String mosClass = getMobileOperatingSystemClass(); - if (mosClass != null) { - cssClass = cssClass + " " + prefix + mosClass; - } } return cssClass; } private String getOperatingSystemClass() { - if (browserDetails.isWindows()) { + if (browserDetails.isAndroid()) { + return OS_ANDROID; + } else if (browserDetails.isIOS()) { + return OS_IOS; + } else if (browserDetails.isWindows()) { return OS_WINDOWS; } else if (browserDetails.isLinux()) { return OS_LINUX; @@ -194,16 +193,6 @@ public class BrowserInfo { return null; } - private String getMobileOperatingSystemClass() { - if (isAndroid()) { - return MOS_ANDROID; - } else if (browserDetails.isIOS()) { - return MOS_IOS; - } - // Unknown MOS - return null; - } - public boolean isIE() { return browserDetails.isIE(); } diff --git a/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java b/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java index 8e9d683baf..fa5fdc6d47 100644 --- a/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java +++ b/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java @@ -29,14 +29,9 @@ public class VBrowserDetails implements Serializable { private boolean isIE = false; private OperatingSystem os = OperatingSystem.UNKNOWN; - private MobileSystem ms = MobileSystem.UNKNOWN; public enum OperatingSystem { - UNKNOWN, WINDOWS, MACOSX, LINUX; - } - - public enum MobileSystem { - UNKNOWN, IOS, ANDROID; + UNKNOWN, WINDOWS, MACOSX, LINUX, IOS, ANDROID; } private float browserEngineVersion = -1; @@ -124,18 +119,20 @@ public class VBrowserDetails implements Serializable { if (userAgent.contains("windows ")) { os = OperatingSystem.WINDOWS; } else if (userAgent.contains("linux")) { - os = OperatingSystem.LINUX; if (userAgent.contains("android")) { - ms = MobileSystem.ANDROID; + os = OperatingSystem.ANDROID; + } else { + os = OperatingSystem.LINUX; } } else if (userAgent.contains("macintosh") || userAgent.contains("mac osx") || userAgent.contains("mac os x")) { - os = OperatingSystem.MACOSX; if (userAgent.contains("ipad") || userAgent.contains("ipod") || userAgent.contains("iphone")) { - ms = MobileSystem.IOS; + os = OperatingSystem.IOS; + } else { + os = OperatingSystem.MACOSX; } } } @@ -323,7 +320,7 @@ public class VBrowserDetails implements Serializable { * @return true if run on Android, false otherwise */ public boolean isAndroid() { - return ms == MobileSystem.ANDROID; + return os == OperatingSystem.ANDROID; } /** @@ -332,7 +329,7 @@ public class VBrowserDetails implements Serializable { * @return true if run in iOS, false otherwise */ public boolean isIOS() { - return ms == MobileSystem.IOS; + return os == OperatingSystem.IOS; } } |