From be6c1ab546a0419b25b1a1637ed13bb5445d8483 Mon Sep 17 00:00:00 2001 From: "thomasvl@chromium.org" Date: Tue, 17 Mar 2009 20:32:34 +0000 Subject: Some upstream code assumes that the executable path from the path service is standardized, but NSBundle makes not such promise, so we standardize it ourselves. While here, remove the app data dir support since it seems the installer and windows sandbox are the only things that need it. Moved that code upstream to the chrome paths... Directly handle the user data dir w/in the chrome path service call back, return different things for chrome vs. chromium. Review URL: http://codereview.chromium.org/48089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11910 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/chrome_paths_mac.mm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'chrome/common/chrome_paths_mac.mm') 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) { -- cgit v1.1