| 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 #ifndef BASE_ANDROID_PATH_UTILS_H_ | 5 #ifndef BASE_ANDROID_PATH_UTILS_H_ |
| 6 #define BASE_ANDROID_PATH_UTILS_H_ | 6 #define BASE_ANDROID_PATH_UTILS_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 |
| 10 class FilePath; |
| 10 | 11 |
| 11 namespace base { | 12 namespace base { |
| 12 namespace android { | 13 namespace android { |
| 13 | 14 |
| 14 // Return the absolute path to the data directory of the current application. | 15 // Retrieves the absolute path to the data directory of the current |
| 16 // application. The result is placed in the FilePath pointed to by 'result'. |
| 15 // This method is dedicated for base_paths_android.c, Using | 17 // This method is dedicated for base_paths_android.c, Using |
| 16 // PathService::Get(base::DIR_ANDROID_APP_DATA, ...) gets the data dir. | 18 // PathService::Get(base::DIR_ANDROID_APP_DATA, ...) gets the data dir. |
| 17 std::string GetDataDirectory(); | 19 bool GetDataDirectory(FilePath* result); |
| 18 | 20 |
| 19 // Return the absolute path to the cache directory. This method is dedicated for | 21 // Retrieves the absolute path to the cache directory. The result is placed in |
| 22 // the FilePath pointed to by 'result'. This method is dedicated for |
| 20 // base_paths_android.c, Using PathService::Get(base::DIR_CACHE, ...) gets the | 23 // base_paths_android.c, Using PathService::Get(base::DIR_CACHE, ...) gets the |
| 21 // cache dir. | 24 // cache dir. |
| 22 std::string GetCacheDirectory(); | 25 bool GetCacheDirectory(FilePath* result); |
| 23 | 26 |
| 24 // Returns the path to the public downloads directory. | 27 // Retrieves the path to the public downloads directory. The result is placed |
| 25 std::string GetDownloadsDirectory(); | 28 // in the FilePath pointed to by 'result'. |
| 29 bool GetDownloadsDirectory(FilePath* result); |
| 26 | 30 |
| 27 // Returns the path to the native JNI libraries via | 31 // Retrieves the path to the native JNI libraries via |
| 28 // ApplicationInfo.nativeLibraryDir on the Java side. | 32 // ApplicationInfo.nativeLibraryDir on the Java side. The result is placed in |
| 29 std::string GetNativeLibraryDirectory(); | 33 // the FilePath pointed to by 'result'. |
| 34 bool GetNativeLibraryDirectory(FilePath* result); |
| 30 | 35 |
| 31 // Returns the absolute path to the external storage directory. | 36 // Retrieves the absolute path to the external storage directory. The result |
| 32 std::string GetExternalStorageDirectory(); | 37 // is placed in the FilePath pointed to by 'result'. |
| 38 bool GetExternalStorageDirectory(FilePath* result); |
| 33 | 39 |
| 34 bool RegisterPathUtils(JNIEnv* env); | 40 bool RegisterPathUtils(JNIEnv* env); |
| 35 | 41 |
| 36 } // namespace android | 42 } // namespace android |
| 37 } // namespace base | 43 } // namespace base |
| 38 | 44 |
| 39 #endif // BASE_ANDROID_PATH_UTILS_H_ | 45 #endif // BASE_ANDROID_PATH_UTILS_H_ |
| OLD | NEW |