| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "config.h" | 5 #import "config.h" |
| 6 #import "platform/mac/VersionUtilMac.h" | 6 #import "platform/mac/VersionUtilMac.h" |
| 7 | 7 |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <sys/utsname.h> | 10 #include <sys/utsname.h> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 // Returns the running system's Mac OS X minor version. This is the |y| value | 52 // Returns the running system's Mac OS X minor version. This is the |y| value |
| 53 // in 10.y or 10.y.z. | 53 // in 10.y or 10.y.z. |
| 54 int MacOSXMinorVersion() | 54 int MacOSXMinorVersion() |
| 55 { | 55 { |
| 56 static int minorVersion = MacOSXMinorVersionInternal(); | 56 static int minorVersion = MacOSXMinorVersionInternal(); |
| 57 return minorVersion; | 57 return minorVersion; |
| 58 } | 58 } |
| 59 | 59 |
| 60 enum { | 60 enum { |
| 61 SNOW_LEOPARD_MINOR_VERSION = 6, |
| 61 LION_MINOR_VERSION = 7, | 62 LION_MINOR_VERSION = 7, |
| 62 MAVERICKS_MINOR_VERSION = 9, | 63 MAVERICKS_MINOR_VERSION = 9, |
| 63 YOSEMITE_MINOR_VERSION = 10, | 64 YOSEMITE_MINOR_VERSION = 10, |
| 64 EL_CAPITAN_MINOR_VERSION = 11, | 65 EL_CAPITAN_MINOR_VERSION = 11, |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace | 68 } // namespace |
| 68 | 69 |
| 69 namespace blink { | 70 namespace blink { |
| 70 | 71 |
| 72 bool IsOSSnowLeopard() |
| 73 { |
| 74 return MacOSXMinorVersion() == SNOW_LEOPARD_MINOR_VERSION; |
| 75 } |
| 76 |
| 71 bool IsOSLionOrEarlier() | 77 bool IsOSLionOrEarlier() |
| 72 { | 78 { |
| 73 return MacOSXMinorVersion() <= LION_MINOR_VERSION; | 79 return MacOSXMinorVersion() <= LION_MINOR_VERSION; |
| 74 } | 80 } |
| 75 | 81 |
| 76 bool IsOSMavericksOrEarlier() | 82 bool IsOSMavericksOrEarlier() |
| 77 { | 83 { |
| 78 return MacOSXMinorVersion() <= MAVERICKS_MINOR_VERSION; | 84 return MacOSXMinorVersion() <= MAVERICKS_MINOR_VERSION; |
| 79 } | 85 } |
| 80 | 86 |
| 81 bool IsOSMavericks() | 87 bool IsOSMavericks() |
| 82 { | 88 { |
| 83 return MacOSXMinorVersion() == MAVERICKS_MINOR_VERSION; | 89 return MacOSXMinorVersion() == MAVERICKS_MINOR_VERSION; |
| 84 } | 90 } |
| 85 | 91 |
| 86 bool IsOSYosemite() | 92 bool IsOSYosemite() |
| 87 { | 93 { |
| 88 return MacOSXMinorVersion() == YOSEMITE_MINOR_VERSION; | 94 return MacOSXMinorVersion() == YOSEMITE_MINOR_VERSION; |
| 89 } | 95 } |
| 90 | 96 |
| 91 bool IsOSElCapitan() | 97 bool IsOSElCapitan() |
| 92 { | 98 { |
| 93 return MacOSXMinorVersion() == EL_CAPITAN_MINOR_VERSION; | 99 return MacOSXMinorVersion() == EL_CAPITAN_MINOR_VERSION; |
| 94 } | 100 } |
| 95 | 101 |
| 96 } // namespace blink | 102 } // namespace blink |
| OLD | NEW |