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 #ifndef VersionUtilMac_h | 5 #ifndef VersionUtilMac_h |
6 #define VersionUtilMac_h | 6 #define VersionUtilMac_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 | 9 |
10 #include <AvailabilityMacros.h> | |
11 | |
10 namespace blink { | 12 namespace blink { |
11 | 13 |
12 // Mavericks is Mac OS X 10.9, Darwin 13. | 14 namespace internal { |
13 PLATFORM_EXPORT bool IsOSMavericks(); | |
14 | 15 |
15 // Yosemite is Mac OS X 10.10, Darwin 14. | 16 PLATFORM_EXPORT int MacOSXMinorVersion(); |
Sidney San Martín
2016/08/24 20:07:13
dglazkov@: These functions also exist in base/mac/
| |
16 PLATFORM_EXPORT bool IsOSYosemite(); | |
17 | 17 |
18 // El Capitan is Mac OS X 10.11, Darwin 15. | 18 template <int V, int ID> |
19 PLATFORM_EXPORT bool IsOSElCapitan(); | 19 constexpr bool IsOS() |
20 { | |
21 return (!ID || MAC_OS_X_VERSION_MIN_REQUIRED <= ID) && MacOSXMinorVersion() == V; | |
22 } | |
23 | |
24 } // namespace internal | |
25 | |
26 const auto IsOS10_9 = internal::IsOS<9, MAC_OS_X_VERSION_10_9>; | |
27 const auto IsOS10_10 = internal::IsOS<10, MAC_OS_X_VERSION_10_10>; | |
28 const auto IsOS10_11 = internal::IsOS<11, MAC_OS_X_VERSION_10_11>; | |
20 | 29 |
21 } // namespace blink | 30 } // namespace blink |
22 | 31 |
23 #endif // VersionUtilMac_h | 32 #endif // VersionUtilMac_h |
OLD | NEW |