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" | |
6 | |
7 #include <unistd.h> | 5 #include <unistd.h> |
8 | 6 |
9 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
10 #include "base/android/path_utils.h" | 8 #include "base/android/path_utils.h" |
| 9 #include "base/base_paths.h" |
| 10 #include "base/base_paths_android.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const char kSelfExe[] = "/proc/self/exe"; | 17 const char kSelfExe[] = "/proc/self/exe"; |
18 | 18 |
19 } // namespace | 19 } // namespace |
20 | 20 |
(...skipping 19 matching lines...) Expand all Loading... |
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. | 46 // This const is only used for tests. |
47 *result = FilePath(base::android::GetExternalStorageDirectory()); | 47 *result = FilePath(base::android::GetExternalStorageDirectory()); |
48 return true; | 48 return true; |
49 } | 49 } |
| 50 case base::DIR_USER_DESKTOP: { |
| 51 // Android doesn't support GetUserDesktop. |
| 52 NOTIMPLEMENTED(); |
| 53 return false; |
| 54 } |
50 case base::DIR_CACHE: { | 55 case base::DIR_CACHE: { |
51 *result = FilePath(base::android::GetCacheDirectory()); | 56 *result = FilePath(base::android::GetCacheDirectory()); |
52 return true; | 57 return true; |
53 } | 58 } |
54 case base::DIR_ANDROID_APP_DATA: { | 59 case base::DIR_ANDROID_APP_DATA: { |
55 *result = FilePath(base::android::GetDataDirectory()); | 60 *result = FilePath(base::android::GetDataDirectory()); |
56 return true; | 61 return true; |
57 } | 62 } |
58 case base::DIR_HOME: { | 63 case base::DIR_HOME: { |
59 *result = file_util::GetHomeDir(); | 64 *result = file_util::GetHomeDir(); |
60 return true; | 65 return true; |
61 } | 66 } |
62 case base::DIR_ANDROID_EXTERNAL_STORAGE: { | 67 case base::DIR_ANDROID_EXTERNAL_STORAGE: { |
63 *result = FilePath(base::android::GetExternalStorageDirectory()); | 68 *result = FilePath(base::android::GetExternalStorageDirectory()); |
64 return true; | 69 return true; |
65 } | 70 } |
66 default: { | 71 default: { |
67 // Note: the path system expects this function to override the default | 72 // Note: the path system expects this function to override the default |
68 // behavior. So no need to log an error if we don't support a given | 73 // behavior. So no need to log an error if we don't support a given |
69 // path. The system will just use the default. | 74 // path. The system will just use the default. |
70 return false; | 75 return false; |
71 } | 76 } |
72 } | 77 } |
73 } | 78 } |
74 | 79 |
75 } // namespace base | 80 } // namespace base |
OLD | NEW |