Index: base/android/path_utils.cc |
diff --git a/base/android/path_utils.cc b/base/android/path_utils.cc |
index dc45c28da622dfbab06c0f3b49b35fff02dd6f71..b5888604b1464f45e9e0095dc3603a73c9ea1855 100644 |
--- a/base/android/path_utils.cc |
+++ b/base/android/path_utils.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -15,16 +15,23 @@ namespace android { |
std::string GetDataDirectory() { |
JNIEnv* env = AttachCurrentThread(); |
- ScopedJavaLocalRef<jstring> path(env, Java_PathUtils_getDataDirectory( |
- env, base::android::GetApplicationContext())); |
- return base::android::ConvertJavaStringToUTF8(env, path.obj()); |
+ ScopedJavaLocalRef<jstring> path = |
+ Java_PathUtils_getDataDirectory(env, GetApplicationContext()); |
+ return ConvertJavaStringToUTF8(path); |
} |
std::string GetCacheDirectory() { |
JNIEnv* env = AttachCurrentThread(); |
- ScopedJavaLocalRef<jstring> path(env, Java_PathUtils_getCacheDirectory( |
- env, base::android::GetApplicationContext())); |
- return base::android::ConvertJavaStringToUTF8(env, path.obj()); |
+ ScopedJavaLocalRef<jstring> path = |
+ Java_PathUtils_getCacheDirectory(env, GetApplicationContext()); |
+ return ConvertJavaStringToUTF8(path); |
+} |
+ |
+std::string GetDownloadsDirectory() { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jstring> path = |
+ Java_PathUtils_getDownloadsDirectory(env, GetApplicationContext()); |
+ return ConvertJavaStringToUTF8(path); |
} |
bool RegisterPathUtils(JNIEnv* env) { |
@@ -33,3 +40,4 @@ bool RegisterPathUtils(JNIEnv* env) { |
} // namespace android |
} // namespace base |
+ |
bulach
2012/02/23 18:18:41
nit: extra \n
Mark Mentovai
2012/02/23 18:43:33
Remove the extraneous blank line at the end of thi
Peter Beverloo
2012/02/29 15:40:22
Done.
|