| Index: base/mac/foundation_util.mm
|
| diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
|
| index d9cbbfbc487fe1c602f1d4c2de3c7f4fa88ded2e..ce4c06cdc7246735908650958ba17ff820494c6e 100644
|
| --- a/base/mac/foundation_util.mm
|
| +++ b/base/mac/foundation_util.mm
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/mac/foundation_util.h"
|
| +#include "base/mac/mac_util.h"
|
|
|
| #include <stdlib.h>
|
| #include <string.h>
|
| @@ -128,6 +129,23 @@ bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result) {
|
| return GetSearchPathDirectory(directory, NSUserDomainMask, result);
|
| }
|
|
|
| +void GetDisplayNameForPath(const FilePath& path, std::string* result) {
|
| + FSRef ref;
|
| + if (!FSRefFromPath(path.value(), &ref)) {
|
| + *result = path.BaseName().value();
|
| + return;
|
| + }
|
| +
|
| + CFStringRef str;
|
| + if (LSCopyDisplayNameForRef(&ref, &str)) {
|
| + *result = path.BaseName().value();
|
| + return;
|
| + }
|
| +
|
| + *result = base::SysCFStringRefToUTF8(str);
|
| + NSObjectRelease((void *) str);
|
| +}
|
| +
|
| FilePath GetUserLibraryPath() {
|
| FilePath user_library_path;
|
| if (!GetUserDirectory(NSLibraryDirectory, &user_library_path)) {
|
|
|