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/android/path_utils.h" | 5 #include "base/android/path_utils.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 | 10 |
11 #include "jni/path_utils_jni.h" | 11 #include "jni/PathUtils_jni.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 namespace android { | 14 namespace android { |
15 | 15 |
16 std::string GetDataDirectory() { | 16 std::string GetDataDirectory() { |
17 JNIEnv* env = AttachCurrentThread(); | 17 JNIEnv* env = AttachCurrentThread(); |
18 ScopedJavaLocalRef<jstring> path = | 18 ScopedJavaLocalRef<jstring> path = |
19 Java_PathUtils_getDataDirectory(env, GetApplicationContext()); | 19 Java_PathUtils_getDataDirectory(env, GetApplicationContext()); |
20 return ConvertJavaStringToUTF8(path); | 20 return ConvertJavaStringToUTF8(path); |
21 } | 21 } |
(...skipping 18 matching lines...) Expand all Loading... |
40 Java_PathUtils_getNativeLibraryDirectory(env, GetApplicationContext()); | 40 Java_PathUtils_getNativeLibraryDirectory(env, GetApplicationContext()); |
41 return ConvertJavaStringToUTF8(path); | 41 return ConvertJavaStringToUTF8(path); |
42 } | 42 } |
43 | 43 |
44 bool RegisterPathUtils(JNIEnv* env) { | 44 bool RegisterPathUtils(JNIEnv* env) { |
45 return RegisterNativesImpl(env); | 45 return RegisterNativesImpl(env); |
46 } | 46 } |
47 | 47 |
48 } // namespace android | 48 } // namespace android |
49 } // namespace base | 49 } // namespace base |
OLD | NEW |