| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <AvailabilityMacros.h> | 9 #include <AvailabilityMacros.h> |
| 10 #include <Carbon/Carbon.h> | 10 #include <Carbon/Carbon.h> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // frontmost process, the one whose menu bar is shown at the top of the main | 84 // frontmost process, the one whose menu bar is shown at the top of the main |
| 85 // display. | 85 // display. |
| 86 BASE_EXPORT bool AmIForeground(); | 86 BASE_EXPORT bool AmIForeground(); |
| 87 | 87 |
| 88 // Excludes the file given by |file_path| from being backed up by Time Machine. | 88 // Excludes the file given by |file_path| from being backed up by Time Machine. |
| 89 BASE_EXPORT bool SetFileBackupExclusion(const FilePath& file_path); | 89 BASE_EXPORT bool SetFileBackupExclusion(const FilePath& file_path); |
| 90 | 90 |
| 91 // Sets the process name as displayed in Activity Monitor to process_name. | 91 // Sets the process name as displayed in Activity Monitor to process_name. |
| 92 BASE_EXPORT void SetProcessName(CFStringRef process_name); | 92 BASE_EXPORT void SetProcessName(CFStringRef process_name); |
| 93 | 93 |
| 94 // Returns the Hardware model name, without trailing numbers, if possible. |
| 95 // See http://www.cocoadev.com/index.pl?MacintoshModels for an example list of |
| 96 // models. If an error occurs trying to read the model, this simply returns |
| 97 // "Unknown". |
| 98 BASE_EXPORT std::string GetHardwareModelName(); |
| 99 |
| 94 // Converts a NSImage to a CGImageRef. Normally, the system frameworks can do | 100 // Converts a NSImage to a CGImageRef. Normally, the system frameworks can do |
| 95 // this fine, especially on 10.6. On 10.5, however, CGImage cannot handle | 101 // this fine, especially on 10.6. On 10.5, however, CGImage cannot handle |
| 96 // converting a PDF-backed NSImage into a CGImageRef. This function will | 102 // converting a PDF-backed NSImage into a CGImageRef. This function will |
| 97 // rasterize the PDF into a bitmap CGImage. The caller is responsible for | 103 // rasterize the PDF into a bitmap CGImage. The caller is responsible for |
| 98 // releasing the return value. | 104 // releasing the return value. |
| 99 BASE_EXPORT CGImageRef CopyNSImageToCGImage(NSImage* image); | 105 BASE_EXPORT CGImageRef CopyNSImageToCGImage(NSImage* image); |
| 100 | 106 |
| 101 // Checks if the current application is set as a Login Item, so it will launch | 107 // Checks if the current application is set as a Login Item, so it will launch |
| 102 // on Login. If a non-NULL pointer to is_hidden is passed, the Login Item also | 108 // on Login. If a non-NULL pointer to is_hidden is passed, the Login Item also |
| 103 // is queried for the 'hide on launch' flag. | 109 // is queried for the 'hide on launch' flag. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_7 | 176 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_7 |
| 171 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 | 177 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 |
| 172 inline bool IsOSLion() { return false; } | 178 inline bool IsOSLion() { return false; } |
| 173 inline bool IsOSLaterThanLion() { return true; } | 179 inline bool IsOSLaterThanLion() { return true; } |
| 174 #endif | 180 #endif |
| 175 | 181 |
| 176 } // namespace mac | 182 } // namespace mac |
| 177 } // namespace base | 183 } // namespace base |
| 178 | 184 |
| 179 #endif // BASE_MAC_MAC_UTIL_H_ | 185 #endif // BASE_MAC_MAC_UTIL_H_ |
| OLD | NEW |