Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/android/path_utils.h" | |
| 6 | |
| 7 #include "base/android/auto_jobject.h" | |
| 8 #include "base/android/jni_android.h" | |
| 9 #include "base/android/jni_string.h" | |
| 10 | |
| 11 #include "jni/path_utils_jni.h" | |
| 12 | |
| 13 namespace base { | |
| 14 namespace android { | |
| 15 | |
| 16 std::string GetDataDirectory() { | |
| 17 JNIEnv* env = AttachCurrentThread(); | |
| 18 AutoJObject path = AutoJObject::FromLocalRef( | |
| 19 env, Java_PathUtils_getDataDirectory( | |
| 20 env, base::android::GetApplicationContext())); | |
|
M-A Ruel
2011/11/11 13:09:07
Why specify base::android:: when you are already i
| |
| 21 return base::android::ConvertJavaStringToUTF8( | |
| 22 env, static_cast<jstring>(path.obj())); | |
| 23 } | |
| 24 | |
| 25 std::string GetCacheDirectory() { | |
| 26 JNIEnv* env = AttachCurrentThread(); | |
| 27 AutoJObject path = AutoJObject::FromLocalRef( | |
| 28 env, Java_PathUtils_getCacheDirectory( | |
| 29 env, base::android::GetApplicationContext())); | |
| 30 return base::android::ConvertJavaStringToUTF8( | |
| 31 env, static_cast<jstring>(path.obj())); | |
| 32 } | |
| 33 | |
| 34 bool RegisterPathUtils(JNIEnv* env) { | |
| 35 return RegisterNativesImpl(env); | |
| 36 } | |
| 37 | |
| 38 } // namespace android | |
| 39 } // namespace base | |
| OLD | NEW |