| 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 "platform/mac/VersionUtilMac.h" | 5 #import "platform/mac/VersionUtilMac.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <sys/utsname.h> | 9 #include <sys/utsname.h> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // Returns the running system's Mac OS X minor version. This is the |y| value | 42 // Returns the running system's Mac OS X minor version. This is the |y| value |
| 43 // in 10.y or 10.y.z. Don't call this, it's an implementation detail and the | 43 // in 10.y or 10.y.z. Don't call this, it's an implementation detail and the |
| 44 // result is meant to be cached by MacOSXMinorVersion. | 44 // result is meant to be cached by MacOSXMinorVersion. |
| 45 int MacOSXMinorVersionInternal() | 45 int MacOSXMinorVersionInternal() |
| 46 { | 46 { |
| 47 int darwinMajorVersion = DarwinMajorVersionInternal(); | 47 int darwinMajorVersion = DarwinMajorVersionInternal(); |
| 48 return darwinMajorVersion - 4; | 48 return darwinMajorVersion - 4; |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace |
| 52 |
| 51 // Returns the running system's Mac OS X minor version. This is the |y| value | 53 // Returns the running system's Mac OS X minor version. This is the |y| value |
| 52 // in 10.y or 10.y.z. | 54 // in 10.y or 10.y.z. |
| 53 int MacOSXMinorVersion() | 55 int blink::internal::MacOSXMinorVersion() |
| 54 { | 56 { |
| 55 static int minorVersion = MacOSXMinorVersionInternal(); | 57 static int minorVersion = MacOSXMinorVersionInternal(); |
| 56 return minorVersion; | 58 return minorVersion; |
| 57 } | 59 } |
| 58 | |
| 59 enum { | |
| 60 MAVERICKS_MINOR_VERSION = 9, | |
| 61 YOSEMITE_MINOR_VERSION = 10, | |
| 62 EL_CAPITAN_MINOR_VERSION = 11, | |
| 63 }; | |
| 64 | |
| 65 } // namespace | |
| 66 | |
| 67 namespace blink { | |
| 68 | |
| 69 bool IsOSMavericks() | |
| 70 { | |
| 71 return MacOSXMinorVersion() == MAVERICKS_MINOR_VERSION; | |
| 72 } | |
| 73 | |
| 74 bool IsOSYosemite() | |
| 75 { | |
| 76 return MacOSXMinorVersion() == YOSEMITE_MINOR_VERSION; | |
| 77 } | |
| 78 | |
| 79 bool IsOSElCapitan() | |
| 80 { | |
| 81 return MacOSXMinorVersion() == EL_CAPITAN_MINOR_VERSION; | |
| 82 } | |
| 83 | |
| 84 } // namespace blink | |
| OLD | NEW |