Index: base/android/java/src/org/chromium/base/PathUtils.java |
diff --git a/base/android/java/src/org/chromium/base/PathUtils.java b/base/android/java/src/org/chromium/base/PathUtils.java |
index e46fc300e8409cfad6bb73c8940a75a2787868cc..77affe1054137164b47d51a444af07348c1336b0 100644 |
--- a/base/android/java/src/org/chromium/base/PathUtils.java |
+++ b/base/android/java/src/org/chromium/base/PathUtils.java |
@@ -9,12 +9,14 @@ import android.content.pm.ApplicationInfo; |
import android.os.AsyncTask; |
import android.os.Environment; |
+import java.io.File; |
import java.util.concurrent.ExecutionException; |
/** |
* This class provides the path related methods for the native library. |
*/ |
public abstract class PathUtils { |
+ private static final String THUMBNAIL_DIRECTORY = "textures"; |
private static final int DATA_DIRECTORY = 0; |
private static final int DATABASE_DIRECTORY = 1; |
@@ -22,6 +24,8 @@ public abstract class PathUtils { |
private static final int NUM_DIRECTORIES = 3; |
private static AsyncTask<String, Void, String[]> sDirPathFetchTask; |
+ private static File sThumbnailDirectory; |
+ |
// Prevent instantiation. |
private PathUtils() {} |
@@ -91,6 +95,18 @@ public abstract class PathUtils { |
return getDirectoryPath(CACHE_DIRECTORY); |
} |
+ public static File getThumbnailCacheDirectory(Context appContext) { |
+ if (sThumbnailDirectory == null) { |
+ sThumbnailDirectory = appContext.getDir(THUMBNAIL_DIRECTORY, Context.MODE_PRIVATE); |
+ } |
+ return sThumbnailDirectory; |
+ } |
+ |
+ @CalledByNative |
+ public static String getThumbnailCacheDirectoryPath(Context appContext) { |
+ return getThumbnailCacheDirectory(appContext).getAbsolutePath(); |
+ } |
+ |
/** |
* @return the public downloads directory. |
*/ |