| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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_UTIL_H_ | 5 #ifndef BASE_MAC_UTIL_H_ |
| 6 #define BASE_MAC_UTIL_H_ | 6 #define BASE_MAC_UTIL_H_ |
| 7 | 7 |
| 8 struct FSRef; | 8 struct FSRef; |
| 9 class FilePath; |
| 10 |
| 11 #ifdef __OBJC__ |
| 12 @class NSBundle; |
| 13 #else |
| 14 class NSBundle; |
| 15 #endif |
| 9 | 16 |
| 10 #include <string> | 17 #include <string> |
| 11 | 18 |
| 12 namespace mac_util { | 19 namespace mac_util { |
| 13 | 20 |
| 14 std::string PathFromFSRef(const FSRef& ref); | 21 std::string PathFromFSRef(const FSRef& ref); |
| 15 bool FSRefFromPath(const std::string& path, FSRef* ref); | 22 bool FSRefFromPath(const std::string& path, FSRef* ref); |
| 16 | 23 |
| 17 // Returns true if the application is running from a bundle | 24 // Returns true if the application is running from a bundle |
| 18 bool AmIBundled(); | 25 bool AmIBundled(); |
| 19 | 26 |
| 27 // Returns the main bundle or the override, used for code that needs |
| 28 // to fetch resources from bundles, but work within a unittest where we |
| 29 // aren't a bundle. |
| 30 NSBundle* MainAppBundle(); |
| 31 |
| 32 // Set the bundle that MainAppBundle will return, overriding the default value |
| 33 // (Restore the default by calling SetOverrideAppBundle(nil)). |
| 34 void SetOverrideAppBundle(NSBundle* bundle); |
| 35 void SetOverrideAppBundlePath(const FilePath& file_path); |
| 36 |
| 20 } // namespace mac_util | 37 } // namespace mac_util |
| 21 | 38 |
| 22 #endif // BASE_MAC_UTIL_H_ | 39 #endif // BASE_MAC_UTIL_H_ |
| OLD | NEW |