summaryrefslogtreecommitdiffstats
path: root/base/base_paths_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'base/base_paths_mac.mm')
-rw-r--r--base/base_paths_mac.mm24
1 files changed, 2 insertions, 22 deletions
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm
index ee0de67..df9f362 100644
--- a/base/base_paths_mac.mm
+++ b/base/base_paths_mac.mm
@@ -16,26 +16,6 @@
namespace base {
-namespace {
-
-// TODO(akalin): Export this function somewhere and use it in
-// chrome_paths_mac.mm and mac_util.mm. This is tricky because
-// NSSearchPathDirectory is declared in an Objective C header so we
-// cannot put it in one of the usual locations (where pure C++ files
-// would include them).
-bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result) {
- NSArray* dirs =
- NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES);
- if ([dirs count] < 1) {
- return false;
- }
- NSString* path = [dirs objectAtIndex:0];
- *result = FilePath([path fileSystemRepresentation]);
- return true;
-}
-
-} // namespace
-
bool PathProviderMac(int key, FilePath* result) {
std::string cur;
switch (key) {
@@ -53,9 +33,9 @@ bool PathProviderMac(int key, FilePath* result) {
break;
}
case base::DIR_USER_CACHE:
- return GetUserDirectory(NSCachesDirectory, result);
+ return mac_util::GetUserDirectory(NSCachesDirectory, result);
case base::DIR_APP_DATA:
- return GetUserDirectory(NSApplicationSupportDirectory, result);
+ return mac_util::GetUserDirectory(NSApplicationSupportDirectory, result);
case base::DIR_SOURCE_ROOT: {
PathService::Get(base::DIR_EXE, result);
if (mac_util::AmIBundled()) {