| 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::PathProviderAndroid which replaces base::PathProviderPosix for | 5 // Defines base::PathProviderAndroid which replaces base::PathProviderPosix for |
| 6 // Android in base/path_service.cc. | 6 // Android in base/path_service.cc. |
| 7 | 7 |
| 8 #include <limits.h> | 8 #include <limits.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 *result = FilePath(bin_dir); | 31 *result = FilePath(bin_dir); |
| 32 return true; | 32 return true; |
| 33 } | 33 } |
| 34 case base::FILE_MODULE: | 34 case base::FILE_MODULE: |
| 35 // dladdr didn't work in Android as only the file name was returned. | 35 // dladdr didn't work in Android as only the file name was returned. |
| 36 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
| 37 return false; | 37 return false; |
| 38 case base::DIR_MODULE: | 38 case base::DIR_MODULE: |
| 39 return base::android::GetNativeLibraryDirectory(result); | 39 return base::android::GetNativeLibraryDirectory(result); |
| 40 case base::DIR_SOURCE_ROOT: | 40 case base::DIR_SOURCE_ROOT: |
| 41 // This const is only used for tests. | 41 // Used only by tests. |
| 42 return base::android::GetExternalStorageDirectory(result); | 42 // In that context, hooked up via base/test/test_support_android.cc. |
| 43 NOTIMPLEMENTED(); |
| 44 return false; |
| 43 case base::DIR_USER_DESKTOP: | 45 case base::DIR_USER_DESKTOP: |
| 44 // Android doesn't support GetUserDesktop. | 46 // Android doesn't support GetUserDesktop. |
| 45 NOTIMPLEMENTED(); | 47 NOTIMPLEMENTED(); |
| 46 return false; | 48 return false; |
| 47 case base::DIR_CACHE: | 49 case base::DIR_CACHE: |
| 48 return base::android::GetCacheDirectory(result); | 50 return base::android::GetCacheDirectory(result); |
| 49 case base::DIR_ANDROID_APP_DATA: | 51 case base::DIR_ANDROID_APP_DATA: |
| 50 return base::android::GetDataDirectory(result); | 52 return base::android::GetDataDirectory(result); |
| 51 case base::DIR_ANDROID_EXTERNAL_STORAGE: | 53 case base::DIR_ANDROID_EXTERNAL_STORAGE: |
| 52 return base::android::GetExternalStorageDirectory(result); | 54 return base::android::GetExternalStorageDirectory(result); |
| 53 default: | 55 default: |
| 54 // Note: the path system expects this function to override the default | 56 // Note: the path system expects this function to override the default |
| 55 // behavior. So no need to log an error if we don't support a given | 57 // behavior. So no need to log an error if we don't support a given |
| 56 // path. The system will just use the default. | 58 // path. The system will just use the default. |
| 57 return false; | 59 return false; |
| 58 } | 60 } |
| 59 } | 61 } |
| 60 | 62 |
| 61 } // namespace base | 63 } // namespace base |
| OLD | NEW |