Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1221)

Unified Diff: base/android/path_utils.cc

Issue 9443018: Upstream Android's PathUtils implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased patch Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/android/path_utils.cc
diff --git a/base/android/path_utils.cc b/base/android/path_utils.cc
index dc45c28da622dfbab06c0f3b49b35fff02dd6f71..c46e6693aaff9590e2d5422c56589ca8fcbd9ef2 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) {
« no previous file with comments | « base/android/java/org/chromium/base/PathUtils.java ('k') | base/base.gyp » ('j') | base/base.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698