Chromium Code Reviews| 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> |
| 11 | 11 |
| 12 #include "base/base_export.h" | 12 #include "base/base_export.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 | 14 |
| 15 #if defined(__OBJC__) | 15 #if defined(__OBJC__) |
| 16 #import <Foundation/Foundation.h> | 16 #import <Foundation/Foundation.h> |
| 17 #else // __OBJC__ | 17 #else // __OBJC__ |
| 18 class NSImage; | 18 class NSImage; |
| 19 class NSString; | |
| 19 #endif // __OBJC__ | 20 #endif // __OBJC__ |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 | 23 |
| 23 class FilePath; | 24 class FilePath; |
| 24 | 25 |
| 25 namespace mac { | 26 namespace mac { |
| 26 | 27 |
| 27 // Full screen modes, in increasing order of priority. More permissive modes | 28 // Full screen modes, in increasing order of priority. More permissive modes |
| 28 // take predecence. | 29 // take predecence. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 BASE_EXPORT bool WasLaunchedAsLoginItemRestoreState(); | 114 BASE_EXPORT bool WasLaunchedAsLoginItemRestoreState(); |
| 114 | 115 |
| 115 // Returns true if the current process was automatically launched as a | 116 // Returns true if the current process was automatically launched as a |
| 116 // 'Login Item' with 'hide on startup' flag. Used to suppress opening windows. | 117 // 'Login Item' with 'hide on startup' flag. Used to suppress opening windows. |
| 117 BASE_EXPORT bool WasLaunchedAsHiddenLoginItem(); | 118 BASE_EXPORT bool WasLaunchedAsHiddenLoginItem(); |
| 118 | 119 |
| 119 // Remove the quarantine xattr from the given file. Returns false if there was | 120 // Remove the quarantine xattr from the given file. Returns false if there was |
| 120 // an error, or true otherwise. | 121 // an error, or true otherwise. |
| 121 BASE_EXPORT bool RemoveQuarantineAttribute(const FilePath& file_path); | 122 BASE_EXPORT bool RemoveQuarantineAttribute(const FilePath& file_path); |
| 122 | 123 |
| 124 // Return true if 's' is empty or contains at least one printable character | |
| 125 BASE_EXPORT bool StringIsPrintable(NSString* s); | |
|
dtapuska
2015/11/23 14:42:08
This is too generic in the base..
Since you are o
| |
| 126 | |
| 123 // Run-time OS version checks. Use these instead of | 127 // Run-time OS version checks. Use these instead of |
| 124 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and | 128 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and |
| 125 // "OrLater" variants to those that check for a specific version, unless you | 129 // "OrLater" variants to those that check for a specific version, unless you |
| 126 // know for sure that you need to check for a specific version. | 130 // know for sure that you need to check for a specific version. |
| 127 | 131 |
| 128 // Snow Leopard is Mac OS X 10.6, Darwin 10. | 132 // Snow Leopard is Mac OS X 10.6, Darwin 10. |
| 129 BASE_EXPORT bool IsOSSnowLeopard(); | 133 BASE_EXPORT bool IsOSSnowLeopard(); |
| 130 | 134 |
| 131 // Lion is Mac OS X 10.7, Darwin 11. | 135 // Lion is Mac OS X 10.7, Darwin 11. |
| 132 BASE_EXPORT bool IsOSLion(); | 136 BASE_EXPORT bool IsOSLion(); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 // If any error occurs, none of the input pointers are touched. | 244 // If any error occurs, none of the input pointers are touched. |
| 241 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, | 245 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, |
| 242 std::string* type, | 246 std::string* type, |
| 243 int32* major, | 247 int32* major, |
| 244 int32* minor); | 248 int32* minor); |
| 245 | 249 |
| 246 } // namespace mac | 250 } // namespace mac |
| 247 } // namespace base | 251 } // namespace base |
| 248 | 252 |
| 249 #endif // BASE_MAC_MAC_UTIL_H_ | 253 #endif // BASE_MAC_MAC_UTIL_H_ |
| OLD | NEW |