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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // SystemPreferences->Accounts->LoginItems or marking Application in the Dock | 108 // SystemPreferences->Accounts->LoginItems or marking Application in the Dock |
109 // as "Options->Open on Login". | 109 // as "Options->Open on Login". |
110 // Does nothing if the application is already set up as Login Item with | 110 // Does nothing if the application is already set up as Login Item with |
111 // specified hide flag. | 111 // specified hide flag. |
112 BASE_EXPORT void AddToLoginItems(bool hide_on_startup); | 112 BASE_EXPORT void AddToLoginItems(bool hide_on_startup); |
113 | 113 |
114 // Removes the current application from the list Of Login Items. | 114 // Removes the current application from the list Of Login Items. |
115 BASE_EXPORT void RemoveFromLoginItems(); | 115 BASE_EXPORT void RemoveFromLoginItems(); |
116 | 116 |
117 // Returns true if the current process was automatically launched as a | 117 // Returns true if the current process was automatically launched as a |
| 118 // 'Login Item' or via Lion's Resume. Used to suppress opening windows. |
| 119 BASE_EXPORT bool WasLaunchedAsLoginOrResumeItem(); |
| 120 |
| 121 // Returns true if the current process was automatically launched as a |
118 // 'Login Item' with 'hide on startup' flag. Used to suppress opening windows. | 122 // 'Login Item' with 'hide on startup' flag. Used to suppress opening windows. |
119 BASE_EXPORT bool WasLaunchedAsHiddenLoginItem(); | 123 BASE_EXPORT bool WasLaunchedAsHiddenLoginItem(); |
120 | 124 |
121 // Run-time OS version checks. Use these instead of | 125 // Run-time OS version checks. Use these instead of |
122 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and | 126 // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and |
123 // "OrLater" variants to those that check for a specific version, unless you | 127 // "OrLater" variants to those that check for a specific version, unless you |
124 // know for sure that you need to check for a specific version. | 128 // know for sure that you need to check for a specific version. |
125 | 129 |
126 // Leopard is Mac OS X 10.5, Darwin 9. | 130 // Leopard is Mac OS X 10.5, Darwin 9. |
127 BASE_EXPORT bool IsOSLeopard(); | 131 BASE_EXPORT bool IsOSLeopard(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_7 | 170 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_7 |
167 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 | 171 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 |
168 inline bool IsOSLion() { return false; } | 172 inline bool IsOSLion() { return false; } |
169 inline bool IsOSLaterThanLion() { return true; } | 173 inline bool IsOSLaterThanLion() { return true; } |
170 #endif | 174 #endif |
171 | 175 |
172 } // namespace mac | 176 } // namespace mac |
173 } // namespace base | 177 } // namespace base |
174 | 178 |
175 #endif // BASE_MAC_MAC_UTIL_H_ | 179 #endif // BASE_MAC_MAC_UTIL_H_ |
OLD | NEW |