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

Unified Diff: base/android/java/src/org/chromium/base/PathUtils.java

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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/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.
*/

Powered by Google App Engine
This is Rietveld 408576698