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 <string> | 10 #include <string> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // Returns true if the current process was automatically launched as a | 120 // Returns true if the current process was automatically launched as a |
121 // 'Login Item' with 'hide on startup' flag. Used to suppress opening windows. | 121 // 'Login Item' with 'hide on startup' flag. Used to suppress opening windows. |
122 BASE_EXPORT bool WasLaunchedAsHiddenLoginItem(); | 122 BASE_EXPORT bool WasLaunchedAsHiddenLoginItem(); |
123 | 123 |
124 // Run-time OS version checks. Use these instead of | 124 // Run-time OS version checks. Use these instead of |
125 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and | 125 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and |
126 // "OrLater" variants to those that check for a specific version, unless you | 126 // "OrLater" variants to those that check for a specific version, unless you |
127 // know for sure that you need to check for a specific version. | 127 // know for sure that you need to check for a specific version. |
128 | 128 |
129 // Leopard is Mac OS X 10.5, Darwin 9. | |
130 BASE_EXPORT bool IsOSLeopard(); | |
131 BASE_EXPORT bool IsOSLeopardOrEarlier(); | |
132 | |
133 // Snow Leopard is Mac OS X 10.6, Darwin 10. | 129 // Snow Leopard is Mac OS X 10.6, Darwin 10. |
134 BASE_EXPORT bool IsOSSnowLeopard(); | 130 BASE_EXPORT bool IsOSSnowLeopard(); |
135 BASE_EXPORT bool IsOSSnowLeopardOrEarlier(); | 131 BASE_EXPORT bool IsOSSnowLeopardOrEarlier(); |
136 BASE_EXPORT bool IsOSSnowLeopardOrLater(); | 132 BASE_EXPORT bool IsOSSnowLeopardOrLater(); |
137 | 133 |
138 // Lion is Mac OS X 10.7, Darwin 11. | 134 // Lion is Mac OS X 10.7, Darwin 11. |
139 BASE_EXPORT bool IsOSLion(); | 135 BASE_EXPORT bool IsOSLion(); |
140 BASE_EXPORT bool IsOSLionOrEarlier(); | 136 BASE_EXPORT bool IsOSLionOrEarlier(); |
141 BASE_EXPORT bool IsOSLionOrLater(); | 137 BASE_EXPORT bool IsOSLionOrLater(); |
142 | 138 |
143 // Mountain Lion is Mac OS X 10.8, Darwin 12. | 139 // Mountain Lion is Mac OS X 10.8, Darwin 12. |
144 BASE_EXPORT bool IsOSMountainLion(); | 140 BASE_EXPORT bool IsOSMountainLion(); |
145 BASE_EXPORT bool IsOSMountainLionOrLater(); | 141 BASE_EXPORT bool IsOSMountainLionOrLater(); |
146 | 142 |
147 // This should be infrequently used. It only makes sense to use this to avoid | 143 // This should be infrequently used. It only makes sense to use this to avoid |
148 // codepaths that are very likely to break on future (unreleased, untested, | 144 // codepaths that are very likely to break on future (unreleased, untested, |
149 // unborn) OS releases. | 145 // unborn) OS releases. |
150 BASE_EXPORT | 146 BASE_EXPORT |
151 bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); | 147 bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); |
152 | 148 |
153 // When the deployment target is set, the code produced cannot run on earlier | 149 // When the deployment target is set, the code produced cannot run on earlier |
154 // OS releases. That enables some of the IsOS* family to be implemented as | 150 // OS releases. That enables some of the IsOS* family to be implemented as |
155 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro | 151 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro |
156 // contains the value of the deployment target. | 152 // contains the value of the deployment target. |
157 | 153 |
158 #if defined(MAC_OS_X_VERSION_10_6) && \ | 154 #if defined(MAC_OS_X_VERSION_10_6) && \ |
159 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | 155 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 |
160 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_6 | 156 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_6 |
161 inline bool IsOSLeopard() { return false; } | |
162 inline bool IsOSLeopardOrEarlier() { return false; } | |
163 inline bool IsOSSnowLeopardOrLater() { return true; } | 157 inline bool IsOSSnowLeopardOrLater() { return true; } |
164 #endif | 158 #endif |
165 | 159 |
166 #if defined(MAC_OS_X_VERSION_10_7) && \ | 160 #if defined(MAC_OS_X_VERSION_10_7) && \ |
167 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | 161 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 |
168 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7 | 162 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7 |
169 inline bool IsOSSnowLeopard() { return false; } | 163 inline bool IsOSSnowLeopard() { return false; } |
170 inline bool IsOSSnowLeopardOrEarlier() { return false; } | 164 inline bool IsOSSnowLeopardOrEarlier() { return false; } |
171 inline bool IsOSLionOrLater() { return true; } | 165 inline bool IsOSLionOrLater() { return true; } |
172 #endif | 166 #endif |
(...skipping 30 matching lines...) Expand all Loading... |
203 // If any error occurs, none of the input pointers are touched. | 197 // If any error occurs, none of the input pointers are touched. |
204 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, | 198 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, |
205 std::string* type, | 199 std::string* type, |
206 int32* major, | 200 int32* major, |
207 int32* minor); | 201 int32* minor); |
208 | 202 |
209 } // namespace mac | 203 } // namespace mac |
210 } // namespace base | 204 } // namespace base |
211 | 205 |
212 #endif // BASE_MAC_MAC_UTIL_H_ | 206 #endif // BASE_MAC_MAC_UTIL_H_ |
OLD | NEW |