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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 BASE_EXPORT void ActivateProcess(pid_t pid); | 85 BASE_EXPORT void ActivateProcess(pid_t pid); |
86 | 86 |
87 // Returns true if this process is in the foreground, meaning that it's the | 87 // Returns true if this process is in the foreground, meaning that it's the |
88 // frontmost process, the one whose menu bar is shown at the top of the main | 88 // frontmost process, the one whose menu bar is shown at the top of the main |
89 // display. | 89 // display. |
90 BASE_EXPORT bool AmIForeground(); | 90 BASE_EXPORT bool AmIForeground(); |
91 | 91 |
92 // Excludes the file given by |file_path| from being backed up by Time Machine. | 92 // Excludes the file given by |file_path| from being backed up by Time Machine. |
93 BASE_EXPORT bool SetFileBackupExclusion(const FilePath& file_path); | 93 BASE_EXPORT bool SetFileBackupExclusion(const FilePath& file_path); |
94 | 94 |
95 // Sets the process name as displayed in Activity Monitor to process_name. | |
96 BASE_EXPORT void SetProcessName(CFStringRef process_name); | |
97 | |
98 // Converts a NSImage to a CGImageRef. Normally, the system frameworks can do | 95 // Converts a NSImage to a CGImageRef. Normally, the system frameworks can do |
99 // this fine, especially on 10.6. On 10.5, however, CGImage cannot handle | 96 // this fine, especially on 10.6. On 10.5, however, CGImage cannot handle |
100 // converting a PDF-backed NSImage into a CGImageRef. This function will | 97 // converting a PDF-backed NSImage into a CGImageRef. This function will |
101 // rasterize the PDF into a bitmap CGImage. The caller is responsible for | 98 // rasterize the PDF into a bitmap CGImage. The caller is responsible for |
102 // releasing the return value. | 99 // releasing the return value. |
103 BASE_EXPORT CGImageRef CopyNSImageToCGImage(NSImage* image); | 100 BASE_EXPORT CGImageRef CopyNSImageToCGImage(NSImage* image); |
104 | 101 |
105 // Checks if the current application is set as a Login Item, so it will launch | 102 // Checks if the current application is set as a Login Item, so it will launch |
106 // on Login. If a non-NULL pointer to is_hidden is passed, the Login Item also | 103 // on Login. If a non-NULL pointer to is_hidden is passed, the Login Item also |
107 // is queried for the 'hide on launch' flag. | 104 // is queried for the 'hide on launch' flag. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // If any error occurs, none of the input pointers are touched. | 211 // If any error occurs, none of the input pointers are touched. |
215 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, | 212 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, |
216 std::string* type, | 213 std::string* type, |
217 int32* major, | 214 int32* major, |
218 int32* minor); | 215 int32* minor); |
219 | 216 |
220 } // namespace mac | 217 } // namespace mac |
221 } // namespace base | 218 } // namespace base |
222 | 219 |
223 #endif // BASE_MAC_MAC_UTIL_H_ | 220 #endif // BASE_MAC_MAC_UTIL_H_ |
OLD | NEW |