Index: base/mac_util.mm |
diff --git a/base/mac_util.mm b/base/mac_util.mm |
index 156cb1c2fa7ba02d5d236dec7c9f63240c873213..5304b7585876f530c6b9c134ba205892a941b95d 100644 |
--- a/base/mac_util.mm |
+++ b/base/mac_util.mm |
@@ -53,6 +53,20 @@ NSBundle* MainAppBundle() { |
return [NSBundle mainBundle]; |
} |
+FilePath GetUserLibraryPath() { |
+ NSArray* dirs = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, |
+ NSUserDomainMask, YES); |
+ if ([dirs count] == 0) |
+ return FilePath(); |
+ |
+ NSString* library_dir = [dirs objectAtIndex:0]; |
+ const char* library_dir_path = [library_dir fileSystemRepresentation]; |
+ if (!library_dir_path) |
+ return FilePath(); |
+ |
+ return FilePath(library_dir_path); |
+} |
+ |
void SetOverrideAppBundle(NSBundle* bundle) { |
[g_override_app_bundle release]; |
g_override_app_bundle = [bundle retain]; |