| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Defines base::PathProviderMac which replaces base::PathProviderPosix for Mac | 5 // Defines base::PathProviderMac which replaces base::PathProviderPosix for Mac |
| 6 // in base/path_service.cc. | 6 // in base/path_service.cc. |
| 7 | 7 |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 #include <mach-o/dyld.h> | 10 #include <mach-o/dyld.h> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium | 85 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium |
| 86 *result = result->DirName().DirName().DirName().DirName().DirName(); | 86 *result = result->DirName().DirName().DirName().DirName().DirName(); |
| 87 } else { | 87 } else { |
| 88 // Unit tests execute two levels deep from the source root, eg: | 88 // Unit tests execute two levels deep from the source root, eg: |
| 89 // src/xcodebuild/{Debug|Release}/base_unittests | 89 // src/xcodebuild/{Debug|Release}/base_unittests |
| 90 *result = result->DirName().DirName(); | 90 *result = result->DirName().DirName(); |
| 91 } | 91 } |
| 92 #endif | 92 #endif |
| 93 return true; | 93 return true; |
| 94 case base::DIR_USER_DESKTOP: | 94 case base::DIR_USER_DESKTOP: |
| 95 #if defined(OS_IOS) |
| 96 // iOS does not have desktop directories. |
| 97 NOTIMPLEMENTED(); |
| 98 return false; |
| 99 #else |
| 95 return base::mac::GetUserDirectory(NSDesktopDirectory, result); | 100 return base::mac::GetUserDirectory(NSDesktopDirectory, result); |
| 101 #endif |
| 96 case base::DIR_CACHE: | 102 case base::DIR_CACHE: |
| 97 return base::mac::GetUserDirectory(NSCachesDirectory, result); | 103 return base::mac::GetUserDirectory(NSCachesDirectory, result); |
| 98 case base::DIR_HOME: | 104 case base::DIR_HOME: |
| 99 *result = base::mac::NSStringToFilePath(NSHomeDirectory()); | 105 *result = base::mac::NSStringToFilePath(NSHomeDirectory()); |
| 100 return true; | 106 return true; |
| 101 default: | 107 default: |
| 102 return false; | 108 return false; |
| 103 } | 109 } |
| 104 } | 110 } |
| 105 | 111 |
| 106 } // namespace base | 112 } // namespace base |
| OLD | NEW |