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 #include "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/path_utils.h" | 10 #include "base/android/path_utils.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 case base::FILE_MODULE: { | 36 case base::FILE_MODULE: { |
37 // dladdr didn't work in Android as only the file name was returned. | 37 // dladdr didn't work in Android as only the file name was returned. |
38 NOTIMPLEMENTED(); | 38 NOTIMPLEMENTED(); |
39 return false; | 39 return false; |
40 } | 40 } |
41 case base::DIR_MODULE: { | 41 case base::DIR_MODULE: { |
42 *result = FilePath(base::android::GetNativeLibraryDirectory()); | 42 *result = FilePath(base::android::GetNativeLibraryDirectory()); |
43 return true; | 43 return true; |
44 } | 44 } |
45 case base::DIR_SOURCE_ROOT: { | 45 case base::DIR_SOURCE_ROOT: { |
46 // This const is only used for tests. Files in this directory are pushed | 46 // This const is only used for tests. |
47 // to the device via test script. | 47 *result = FilePath(base::android::GetExternalStorageDirectory()); |
48 *result = FilePath(FILE_PATH_LITERAL("/data/local/tmp/")); | |
49 return true; | 48 return true; |
50 } | 49 } |
51 case base::DIR_CACHE: { | 50 case base::DIR_CACHE: { |
52 *result = FilePath(base::android::GetCacheDirectory()); | 51 *result = FilePath(base::android::GetCacheDirectory()); |
53 return true; | 52 return true; |
54 } | 53 } |
55 case base::DIR_ANDROID_APP_DATA: { | 54 case base::DIR_ANDROID_APP_DATA: { |
56 *result = FilePath(base::android::GetDataDirectory()); | 55 *result = FilePath(base::android::GetDataDirectory()); |
57 return true; | 56 return true; |
58 } | 57 } |
59 case base::DIR_HOME: { | 58 case base::DIR_HOME: { |
60 *result = file_util::GetHomeDir(); | 59 *result = file_util::GetHomeDir(); |
61 return true; | 60 return true; |
62 } | 61 } |
63 case base::DIR_ANDROID_EXTERNAL_STORAGE: { | 62 case base::DIR_ANDROID_EXTERNAL_STORAGE: { |
64 *result = FilePath(base::android::GetExternalStorageDirectory()); | 63 *result = FilePath(base::android::GetExternalStorageDirectory()); |
65 return true; | 64 return true; |
66 } | 65 } |
67 default: { | 66 default: { |
68 // Note: the path system expects this function to override the default | 67 // Note: the path system expects this function to override the default |
69 // behavior. So no need to log an error if we don't support a given | 68 // behavior. So no need to log an error if we don't support a given |
70 // path. The system will just use the default. | 69 // path. The system will just use the default. |
71 return false; | 70 return false; |
72 } | 71 } |
73 } | 72 } |
74 } | 73 } |
75 | 74 |
76 } // namespace base | 75 } // namespace base |
OLD | NEW |