summaryrefslogtreecommitdiffstats
path: root/chrome/common/chrome_paths_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/chrome_paths_mac.mm')
-rw-r--r--chrome/common/chrome_paths_mac.mm20
1 files changed, 17 insertions, 3 deletions
diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm
index e8e8f92..f4ad3d5 100644
--- a/chrome/common/chrome_paths_mac.mm
+++ b/chrome/common/chrome_paths_mac.mm
@@ -14,9 +14,23 @@
namespace chrome {
bool GetDefaultUserDataDirectory(FilePath* result) {
- if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result))
- return false;
- return true;
+ bool success = false;
+ NSArray* dirs =
+ NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
+ NSUserDomainMask, YES);
+ if ([dirs count] && result) {
+ NSString* base = [dirs objectAtIndex:0];
+#if defined(GOOGLE_CHROME_BUILD)
+ base = [base stringByAppendingPathComponent@"Google"];
+ NSString* tail = @"Chrome";
+#else
+ NSString* tail = @"Chromium";
+#endif
+ NSString* path = [base stringByAppendingPathComponent:tail];
+ *result = FilePath([path fileSystemRepresentation]);
+ success = true;
+ }
+ return success;
}
bool GetUserDocumentsDirectory(FilePath* result) {