Bug 913953 - Part b: Remove unused override app bundle code; r=ehsan

This commit is contained in:
Ms2ger 2013-09-10 09:03:31 +02:00
parent 38bd752a97
commit 8c9fb0cabf
2 changed files with 0 additions and 39 deletions

View File

@ -6,13 +6,6 @@
#define BASE_MAC_UTIL_H_ #define BASE_MAC_UTIL_H_
struct FSRef; struct FSRef;
class FilePath;
#ifdef __OBJC__
@class NSBundle;
#else
class NSBundle;
#endif
#include <string> #include <string>
@ -24,16 +17,6 @@ bool FSRefFromPath(const std::string& path, FSRef* ref);
// Returns true if the application is running from a bundle // Returns true if the application is running from a bundle
bool AmIBundled(); bool AmIBundled();
// Returns the main bundle or the override, used for code that needs
// to fetch resources from bundles, but work within a unittest where we
// aren't a bundle.
NSBundle* MainAppBundle();
// Set the bundle that MainAppBundle will return, overriding the default value
// (Restore the default by calling SetOverrideAppBundle(nil)).
void SetOverrideAppBundle(NSBundle* bundle);
void SetOverrideAppBundlePath(const FilePath& file_path);
} // namespace mac_util } // namespace mac_util
#endif // BASE_MAC_UTIL_H_ #endif // BASE_MAC_UTIL_H_

View File

@ -44,26 +44,4 @@ bool AmIBundled() {
return info.nodeFlags & kFSNodeIsDirectoryMask; return info.nodeFlags & kFSNodeIsDirectoryMask;
} }
// No threading worries since NSBundle isn't thread safe.
static NSBundle* g_override_app_bundle = nil;
NSBundle* MainAppBundle() {
if (g_override_app_bundle)
return g_override_app_bundle;
return [NSBundle mainBundle];
}
void SetOverrideAppBundle(NSBundle* bundle) {
[g_override_app_bundle release];
g_override_app_bundle = [bundle retain];
}
void SetOverrideAppBundlePath(const FilePath& file_path) {
NSString* path = base::SysUTF8ToNSString(file_path.value());
NSBundle* bundle = [NSBundle bundleWithPath:path];
DCHECK(bundle) << "failed to load the bundle: " << file_path.value();
SetOverrideAppBundle(bundle);
}
} // namespace mac_util } // namespace mac_util