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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Returns the running system's Mac OS X minor version. This is the |y| value | 51 // Returns the running system's Mac OS X minor version. This is the |y| value |
52 // in 10.y or 10.y.z. | 52 // in 10.y or 10.y.z. |
53 int MacOSXMinorVersion() | 53 int MacOSXMinorVersion() |
54 { | 54 { |
55 static int minorVersion = MacOSXMinorVersionInternal(); | 55 static int minorVersion = MacOSXMinorVersionInternal(); |
56 return minorVersion; | 56 return minorVersion; |
57 } | 57 } |
58 | 58 |
59 enum { | 59 enum { |
60 LION_MINOR_VERSION = 7, | |
61 MAVERICKS_MINOR_VERSION = 9, | 60 MAVERICKS_MINOR_VERSION = 9, |
62 YOSEMITE_MINOR_VERSION = 10, | 61 YOSEMITE_MINOR_VERSION = 10, |
63 EL_CAPITAN_MINOR_VERSION = 11, | 62 EL_CAPITAN_MINOR_VERSION = 11, |
64 }; | 63 }; |
65 | 64 |
66 } // namespace | 65 } // namespace |
67 | 66 |
68 namespace blink { | 67 namespace blink { |
69 | 68 |
70 bool IsOSLionOrEarlier() | |
71 { | |
72 return MacOSXMinorVersion() <= LION_MINOR_VERSION; | |
73 } | |
74 | |
75 bool IsOSMavericksOrEarlier() | |
76 { | |
77 return MacOSXMinorVersion() <= MAVERICKS_MINOR_VERSION; | |
78 } | |
79 | |
80 bool IsOSMavericks() | 69 bool IsOSMavericks() |
81 { | 70 { |
82 return MacOSXMinorVersion() == MAVERICKS_MINOR_VERSION; | 71 return MacOSXMinorVersion() == MAVERICKS_MINOR_VERSION; |
83 } | 72 } |
84 | 73 |
85 bool IsOSYosemite() | 74 bool IsOSYosemite() |
86 { | 75 { |
87 return MacOSXMinorVersion() == YOSEMITE_MINOR_VERSION; | 76 return MacOSXMinorVersion() == YOSEMITE_MINOR_VERSION; |
88 } | 77 } |
89 | 78 |
90 bool IsOSElCapitan() | 79 bool IsOSElCapitan() |
91 { | 80 { |
92 return MacOSXMinorVersion() == EL_CAPITAN_MINOR_VERSION; | 81 return MacOSXMinorVersion() == EL_CAPITAN_MINOR_VERSION; |
93 } | 82 } |
94 | 83 |
95 } // namespace blink | 84 } // namespace blink |
OLD | NEW |