| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BASE_MAC_MAC_UTIL_H_ | 5 #ifndef BASE_MAC_MAC_UTIL_H_ |
| 6 #define BASE_MAC_MAC_UTIL_H_ | 6 #define BASE_MAC_MAC_UTIL_H_ |
| 7 | 7 |
| 8 #include <AvailabilityMacros.h> | 8 #include <AvailabilityMacros.h> |
| 9 #include <Carbon/Carbon.h> | 9 #include <Carbon/Carbon.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // an error, or true otherwise. | 108 // an error, or true otherwise. |
| 109 BASE_EXPORT bool RemoveQuarantineAttribute(const FilePath& file_path); | 109 BASE_EXPORT bool RemoveQuarantineAttribute(const FilePath& file_path); |
| 110 | 110 |
| 111 // Run-time OS version checks. Use these instead of | 111 // Run-time OS version checks. Use these instead of |
| 112 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and | 112 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and |
| 113 // "OrLater" variants to those that check for a specific version, unless you | 113 // "OrLater" variants to those that check for a specific version, unless you |
| 114 // know for sure that you need to check for a specific version. | 114 // know for sure that you need to check for a specific version. |
| 115 | 115 |
| 116 // Mavericks is OS X 10.9, Darwin 13. | 116 // Mavericks is OS X 10.9, Darwin 13. |
| 117 BASE_EXPORT bool IsOSMavericks(); | 117 BASE_EXPORT bool IsOSMavericks(); |
| 118 BASE_EXPORT bool IsOSMavericksOrLater(); | |
| 119 | 118 |
| 120 // Yosemite is OS X 10.10, Darwin 14. | 119 // Yosemite is OS X 10.10, Darwin 14. |
| 121 BASE_EXPORT bool IsOSYosemite(); | 120 BASE_EXPORT bool IsOSYosemite(); |
| 122 BASE_EXPORT bool IsOSYosemiteOrEarlier(); | 121 BASE_EXPORT bool IsOSYosemiteOrEarlier(); |
| 123 BASE_EXPORT bool IsOSYosemiteOrLater(); | 122 BASE_EXPORT bool IsOSYosemiteOrLater(); |
| 124 | 123 |
| 125 // El Capitan is OS X 10.11, Darwin 15. | 124 // El Capitan is OS X 10.11, Darwin 15. |
| 126 BASE_EXPORT bool IsOSElCapitan(); | 125 BASE_EXPORT bool IsOSElCapitan(); |
| 127 BASE_EXPORT bool IsOSElCapitanOrEarlier(); | 126 BASE_EXPORT bool IsOSElCapitanOrEarlier(); |
| 128 BASE_EXPORT bool IsOSElCapitanOrLater(); | 127 BASE_EXPORT bool IsOSElCapitanOrLater(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 140 // exclusive. | 139 // exclusive. |
| 141 inline bool IsOSYosemiteOrEarlier() { return !IsOSElCapitanOrLater(); } | 140 inline bool IsOSYosemiteOrEarlier() { return !IsOSElCapitanOrLater(); } |
| 142 inline bool IsOSElCapitanOrEarlier() { return !IsOSSierraOrLater(); } | 141 inline bool IsOSElCapitanOrEarlier() { return !IsOSSierraOrLater(); } |
| 143 | 142 |
| 144 // When the deployment target is set, the code produced cannot run on earlier | 143 // When the deployment target is set, the code produced cannot run on earlier |
| 145 // OS releases. That enables some of the IsOS* family to be implemented as | 144 // OS releases. That enables some of the IsOS* family to be implemented as |
| 146 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro | 145 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro |
| 147 // contains the value of the deployment target. | 146 // contains the value of the deployment target. |
| 148 | 147 |
| 149 #if defined(MAC_OS_X_VERSION_10_9) && \ | 148 #if defined(MAC_OS_X_VERSION_10_9) && \ |
| 150 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | |
| 151 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_9 | |
| 152 inline bool IsOSMavericksOrLater() { return true; } | |
| 153 #endif | |
| 154 | |
| 155 #if defined(MAC_OS_X_VERSION_10_9) && \ | |
| 156 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_9 | 149 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_9 |
| 157 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_9 | 150 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_9 |
| 158 inline bool IsOSMavericks() { return false; } | 151 inline bool IsOSMavericks() { return false; } |
| 159 #endif | 152 #endif |
| 160 | 153 |
| 161 #if defined(MAC_OS_X_VERSION_10_10) && \ | 154 #if defined(MAC_OS_X_VERSION_10_10) && \ |
| 162 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | 155 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 |
| 163 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_10 | 156 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_10 |
| 164 inline bool IsOSYosemiteOrLater() { return true; } | 157 inline bool IsOSYosemiteOrLater() { return true; } |
| 165 #endif | 158 #endif |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // If any error occurs, none of the input pointers are touched. | 197 // If any error occurs, none of the input pointers are touched. |
| 205 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, | 198 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, |
| 206 std::string* type, | 199 std::string* type, |
| 207 int32_t* major, | 200 int32_t* major, |
| 208 int32_t* minor); | 201 int32_t* minor); |
| 209 | 202 |
| 210 } // namespace mac | 203 } // namespace mac |
| 211 } // namespace base | 204 } // namespace base |
| 212 | 205 |
| 213 #endif // BASE_MAC_MAC_UTIL_H_ | 206 #endif // BASE_MAC_MAC_UTIL_H_ |
| OLD | NEW |