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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java

Issue 2545343002: Add support for virtual files to Clank. (Closed)
Patch Set: Rebased. Created 4 years 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 | « no previous file | base/android/java/src/org/chromium/base/ContentUriUtils.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
index 323c3ea83bbdc972f9c1977fde9e2de9e656b1e7..c064d2f07d1f9899484ef022582f805992d14974 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
@@ -5,7 +5,6 @@
package org.chromium.android_webview;
import android.annotation.TargetApi;
-import android.content.ContentResolver;
import android.content.Context;
import android.media.AudioManager;
import android.net.Uri;
@@ -237,8 +236,8 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
processId, renderId, modeFlags, null, null);
return;
}
- GetDisplayNameTask task = new GetDisplayNameTask(
- mContext.getContentResolver(), processId, renderId, modeFlags, results);
+ GetDisplayNameTask task =
+ new GetDisplayNameTask(mContext, processId, renderId, modeFlags, results);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}, params);
@@ -339,15 +338,15 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
final int mRenderId;
final int mModeFlags;
final String[] mFilePaths;
- final ContentResolver mContentResolver;
+ final Context mContext;
- public GetDisplayNameTask(ContentResolver contentResolver, int processId, int renderId,
- int modeFlags, String[] filePaths) {
+ public GetDisplayNameTask(
+ Context context, int processId, int renderId, int modeFlags, String[] filePaths) {
mProcessId = processId;
mRenderId = renderId;
mModeFlags = modeFlags;
mFilePaths = filePaths;
- mContentResolver = contentResolver;
+ mContext = context;
}
@Override
@@ -369,10 +368,10 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
* or an empty string otherwise.
*/
private String resolveFileName(String filePath) {
- if (mContentResolver == null || filePath == null) return "";
+ if (filePath == null) return "";
Uri uri = Uri.parse(filePath);
return ContentUriUtils.getDisplayName(
- uri, mContentResolver, MediaStore.MediaColumns.DISPLAY_NAME);
+ uri, mContext, MediaStore.MediaColumns.DISPLAY_NAME);
}
}
}
« no previous file with comments | « no previous file | base/android/java/src/org/chromium/base/ContentUriUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698