Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: base/mac_util.h

Issue 28214: Add a macutil for the main app bundle and override... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/mac_util.mm » ('j') | base/mac_util.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « no previous file | base/mac_util.mm » ('j') | base/mac_util.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698