summaryrefslogtreecommitdiffstats
path: root/chrome/common/chrome_paths_mac.mm
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 01:27:19 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 01:27:19 +0000
commit2438b1729d34840ed380ce1ef4f37f3f56faa5e7 (patch)
tree9f631c1af54409bc0fa13eb6e1743f0a0c3c9fe5 /chrome/common/chrome_paths_mac.mm
parentc80f9b0e650db3addaa0217be50da5bebd323cc3 (diff)
downloadchromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.zip
chromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.tar.gz
chromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.tar.bz2
Moved GetUserDirectory() into mac_util.mm.
Made mac_util.mm and chrome_paths_mac.mm use GetUserDirectory(). Made firefox_importer_utils_mac.mm use PathService. Added unittests for GetUserDirectory(). BUG=22045 TEST=trybots Review URL: http://codereview.chromium.org/548123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_paths_mac.mm')
-rw-r--r--chrome/common/chrome_paths_mac.mm33
1 files changed, 3 insertions, 30 deletions
diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm
index f401751..21868cd 100644
--- a/chrome/common/chrome_paths_mac.mm
+++ b/chrome/common/chrome_paths_mac.mm
@@ -41,42 +41,15 @@ bool GetChromeFrameUserDataDirectory(FilePath* result) {
}
bool GetUserDocumentsDirectory(FilePath* result) {
- bool success = false;
- NSArray* docArray =
- NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
- NSUserDomainMask,
- YES);
- if ([docArray count] && result) {
- *result = FilePath([[docArray objectAtIndex:0] fileSystemRepresentation]);
- success = true;
- }
- return success;
+ return mac_util::GetUserDirectory(NSDocumentDirectory, result);
}
bool GetUserDownloadsDirectory(FilePath* result) {
- bool success = false;
- NSArray* docArray =
- NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory,
- NSUserDomainMask,
- YES);
- if ([docArray count] && result) {
- *result = FilePath([[docArray objectAtIndex:0] fileSystemRepresentation]);
- success = true;
- }
- return success;
+ return mac_util::GetUserDirectory(NSDownloadsDirectory, result);
}
bool GetUserDesktop(FilePath* result) {
- bool success = false;
- NSArray* docArray =
- NSSearchPathForDirectoriesInDomains(NSDesktopDirectory,
- NSUserDomainMask,
- YES);
- if ([docArray count] && result) {
- *result = FilePath([[docArray objectAtIndex:0] fileSystemRepresentation]);
- success = true;
- }
- return success;
+ return mac_util::GetUserDirectory(NSDesktopDirectory, result);
}
FilePath GetVersionedDirectory() {