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

Unified Diff: base/android/java/PathUtils.java

Issue 9443018: Upstream Android's PathUtils implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 8 years, 10 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
« no previous file with comments | « base/android/java/CalledByNative.java ('k') | base/android/path_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/PathUtils.java
diff --git a/base/android/java/PathUtils.java b/base/android/java/PathUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..e0d5817afb1d68f4a68e9b8266a405b9c572a81d
--- /dev/null
+++ b/base/android/java/PathUtils.java
@@ -0,0 +1,43 @@
+// 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.
+
+package org.chromium.chromeview.base;
+
+import android.content.Context;
+import android.os.Environment;
+
+import org.chromium.chromeview.base.CalledByNative;
+
+import java.io.File;
+
+/**
+ * This class provides the path related methods for the native library.
+ */
+class PathUtils {
+
+ /**
+ * @return the private directory that used to store application data.
+ */
+ @CalledByNative
+ public static String getDataDirectory(Context appContext) {
+ return appContext.getDir("chrome", Context.MODE_PRIVATE).getPath();
joth 2012/02/23 14:07:14 base/ should not know about "chrome" at least, th
Peter Beverloo 2012/02/23 14:39:21 Added a TODO and filed an issue downstream, as it
+ }
+
+ /**
+ * @return the cache directory.
+ */
+ @CalledByNative
+ public static String getCacheDirectory(Context appContext) {
+ return appContext.getCacheDir().getPath();
+ }
+
+ /**
+ * @return the public downloads directory.
+ */
+ @CalledByNative
+ public static String getDownloadsDirectory(Context appContext) {
+ return Environment.getExternalStoragePublicDirectory(
+ Environment.DIRECTORY_DOWNLOADS).getPath();
+ }
+}
« no previous file with comments | « base/android/java/CalledByNative.java ('k') | base/android/path_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698