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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // Snow Leopard is Mac OS X 10.6, Darwin 10. | 129 // Snow Leopard is Mac OS X 10.6, Darwin 10. |
130 BASE_EXPORT bool IsOSSnowLeopard(); | 130 BASE_EXPORT bool IsOSSnowLeopard(); |
131 BASE_EXPORT bool IsOSSnowLeopardOrLater(); | |
Mark Mentovai
2012/08/15 02:19:22
Nope. This is a tautology on the trunk.
| |
131 | 132 |
132 // Lion is Mac OS X 10.7, Darwin 11. | 133 // Lion is Mac OS X 10.7, Darwin 11. |
133 BASE_EXPORT bool IsOSLion(); | 134 BASE_EXPORT bool IsOSLion(); |
134 BASE_EXPORT bool IsOSLionOrEarlier(); | 135 BASE_EXPORT bool IsOSLionOrEarlier(); |
135 BASE_EXPORT bool IsOSLionOrLater(); | 136 BASE_EXPORT bool IsOSLionOrLater(); |
136 | 137 |
137 // Mountain Lion is Mac OS X 10.8, Darwin 12. | 138 // Mountain Lion is Mac OS X 10.8, Darwin 12. |
138 BASE_EXPORT bool IsOSMountainLion(); | 139 BASE_EXPORT bool IsOSMountainLion(); |
139 BASE_EXPORT bool IsOSMountainLionOrLater(); | 140 BASE_EXPORT bool IsOSMountainLionOrLater(); |
140 | 141 |
141 // This should be infrequently used. It only makes sense to use this to avoid | 142 // This should be infrequently used. It only makes sense to use this to avoid |
142 // codepaths that are very likely to break on future (unreleased, untested, | 143 // codepaths that are very likely to break on future (unreleased, untested, |
143 // unborn) OS releases. | 144 // unborn) OS releases. |
144 BASE_EXPORT | 145 BASE_EXPORT |
145 bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); | 146 bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); |
146 | 147 |
147 // When the deployment target is set, the code produced cannot run on earlier | 148 // When the deployment target is set, the code produced cannot run on earlier |
148 // OS releases. That enables some of the IsOS* family to be implemented as | 149 // OS releases. That enables some of the IsOS* family to be implemented as |
149 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro | 150 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro |
150 // contains the value of the deployment target. | 151 // contains the value of the deployment target. |
151 | 152 |
152 #if defined(MAC_OS_X_VERSION_10_7) && \ | 153 #if defined(MAC_OS_X_VERSION_10_7) && \ |
153 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | 154 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 |
154 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7 | 155 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7 |
wtc
2012/08/15 02:38:42
Since you didn't define an inline version of IsOSS
| |
155 inline bool IsOSSnowLeopard() { return false; } | 156 inline bool IsOSSnowLeopard() { return false; } |
156 inline bool IsOSLionOrLater() { return true; } | 157 inline bool IsOSLionOrLater() { return true; } |
157 #endif | 158 #endif |
158 | 159 |
159 #if defined(MAC_OS_X_VERSION_10_7) && \ | 160 #if defined(MAC_OS_X_VERSION_10_7) && \ |
160 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 |
161 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 | 162 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 |
162 inline bool IsOSLion() { return false; } | 163 inline bool IsOSLion() { return false; } |
163 inline bool IsOSLionOrEarlier() { return false; } | 164 inline bool IsOSLionOrEarlier() { return false; } |
164 #endif | 165 #endif |
(...skipping 23 matching lines...) Expand all Loading... | |
188 // If any error occurs, none of the input pointers are touched. | 189 // If any error occurs, none of the input pointers are touched. |
189 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, | 190 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, |
190 std::string* type, | 191 std::string* type, |
191 int32* major, | 192 int32* major, |
192 int32* minor); | 193 int32* minor); |
193 | 194 |
194 } // namespace mac | 195 } // namespace mac |
195 } // namespace base | 196 } // namespace base |
196 | 197 |
197 #endif // BASE_MAC_MAC_UTIL_H_ | 198 #endif // BASE_MAC_MAC_UTIL_H_ |
OLD | NEW |