Index: base/base_paths_mac.mm |
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm |
index 14d1c201ca765d35bca7ce8ba87e1fda32e394b7..2227d7d8ad7d8e8f1ee9a537b3ac31342537cd9f 100644 |
--- a/base/base_paths_mac.mm |
+++ b/base/base_paths_mac.mm |
@@ -2,12 +2,14 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "base/base_paths_mac.h" |
+// Defines base::PathProviderMac which replaces base::PathProviderPosix for Mac |
+// in base/path_service.cc. |
#include <dlfcn.h> |
#import <Foundation/Foundation.h> |
#include <mach-o/dyld.h> |
+#include "base/base_paths.h" |
#include "base/compiler_specific.h" |
#include "base/file_path.h" |
#include "base/file_util.h" |
@@ -15,6 +17,7 @@ |
#include "base/mac/foundation_util.h" |
#include "base/path_service.h" |
#include "base/string_util.h" |
+#include "build/build_config.h" |
namespace { |
@@ -57,8 +60,6 @@ bool PathProviderMac(int key, FilePath* result) { |
case base::FILE_MODULE: |
return GetModulePathForAddress(result, |
reinterpret_cast<const void*>(&base::PathProviderMac)); |
- case base::DIR_CACHE: |
- return base::mac::GetUserDirectory(NSCachesDirectory, result); |
case base::DIR_APP_DATA: { |
bool success = base::mac::GetUserDirectory(NSApplicationSupportDirectory, |
result); |
@@ -69,7 +70,7 @@ bool PathProviderMac(int key, FilePath* result) { |
#endif // defined(OS_IOS) |
return success; |
} |
- case base::DIR_SOURCE_ROOT: { |
+ case base::DIR_SOURCE_ROOT: |
// Go through PathService to catch overrides. |
if (!PathService::Get(base::FILE_EXE, result)) |
return false; |
@@ -90,11 +91,13 @@ bool PathProviderMac(int key, FilePath* result) { |
} |
#endif |
return true; |
- } |
- case base::DIR_HOME: { |
+ case base::DIR_USER_DESKTOP: |
+ return base::mac::GetUserDirectory(NSDesktopDirectory, result); |
+ case base::DIR_CACHE: |
+ return base::mac::GetUserDirectory(NSCachesDirectory, result); |
+ case base::DIR_HOME: |
*result = base::mac::NSStringToFilePath(NSHomeDirectory()); |
return true; |
- } |
default: |
return false; |
} |