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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 LION_MINOR_VERSION = 7, | 61 LION_MINOR_VERSION = 7, |
62 MAVERICKS_MINOR_VERSION = 9, | 62 MAVERICKS_MINOR_VERSION = 9, |
| 63 YOSEMITE_MINOR_VERSION = 10, |
| 64 EL_CAPITAN_MINOR_VERSION = 11, |
63 }; | 65 }; |
64 | 66 |
65 } // namespace | 67 } // namespace |
66 | 68 |
67 namespace blink { | 69 namespace blink { |
68 | 70 |
69 bool IsOSLionOrEarlier() | 71 bool IsOSLionOrEarlier() |
70 { | 72 { |
71 return MacOSXMinorVersion() <= LION_MINOR_VERSION; | 73 return MacOSXMinorVersion() <= LION_MINOR_VERSION; |
72 } | 74 } |
73 | 75 |
74 bool IsOSMavericksOrEarlier() | 76 bool IsOSMavericksOrEarlier() |
75 { | 77 { |
76 return MacOSXMinorVersion() <= MAVERICKS_MINOR_VERSION; | 78 return MacOSXMinorVersion() <= MAVERICKS_MINOR_VERSION; |
77 } | 79 } |
78 | 80 |
79 bool IsOSMavericks() | 81 bool IsOSMavericks() |
80 { | 82 { |
81 return MacOSXMinorVersion() == MAVERICKS_MINOR_VERSION; | 83 return MacOSXMinorVersion() == MAVERICKS_MINOR_VERSION; |
82 } | 84 } |
83 | 85 |
| 86 bool IsOSYosemite() |
| 87 { |
| 88 return MacOSXMinorVersion() == YOSEMITE_MINOR_VERSION; |
| 89 } |
| 90 |
| 91 bool IsOSElCapitan() |
| 92 { |
| 93 return MacOSXMinorVersion() == EL_CAPITAN_MINOR_VERSION; |
| 94 } |
| 95 |
84 } // namespace blink | 96 } // namespace blink |
OLD | NEW |