Chromium Code Reviews| Index: base/base_paths_mac.mm |
| diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm |
| index 14d1c201ca765d35bca7ce8ba87e1fda32e394b7..b1378fbb793621223171c363ca995213d295732f 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 |
| +// OS_MAXOSX in base/path_service.cc. |
|
grt (UTC plus 2)
2012/09/19 16:44:46
"OS_MAXOSX" -> "Mac" for consistency with base_pat
gab
2012/09/19 18:22:58
Done.
|
| #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" |
| @@ -51,14 +53,14 @@ namespace base { |
| bool PathProviderMac(int key, FilePath* result) { |
| switch (key) { |
| - case base::FILE_EXE: |
| + case base::FILE_EXE: { |
|
grt (UTC plus 2)
2012/09/19 16:44:46
i think it's more consistent with Chromium style t
gab
2012/09/19 18:22:58
Ok removed it for all but the two big ones (with #
grt (UTC plus 2)
2012/09/19 19:12:06
i don't understand this logic; handling goes until
gab
2012/09/19 19:44:25
You're right, better to go by the simple rule, don
|
| GetNSExecutablePath(result); |
| return true; |
| - case base::FILE_MODULE: |
| + } |
| + 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); |
| @@ -91,6 +93,12 @@ bool PathProviderMac(int key, FilePath* result) { |
| #endif |
| return true; |
| } |
| + 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; |