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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java

Issue 2772343003: Android: Remove GetApplicationContext part 1 (Closed)
Patch Set: rebase Created 3 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: chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java
index 75763894c4609f04028158ab56114c41c9c9665c..5ca97ccdd025b62c5b9760d2ecdc3ffbf67160b6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java
@@ -9,6 +9,7 @@ import android.net.Uri;
import android.support.v4.content.FileProvider;
import org.chromium.base.ContentUriUtils;
+import org.chromium.base.ContextUtils;
import java.io.File;
@@ -20,8 +21,9 @@ public class FileProviderHelper implements ContentUriUtils.FileProviderUtil {
private static final String API_AUTHORITY_SUFFIX = ".FileProvider";
@Override
- public Uri getContentUriFromFile(Context context, File file) {
- return FileProvider.getUriForFile(context,
- context.getPackageName() + API_AUTHORITY_SUFFIX, file);
+ public Uri getContentUriFromFile(File file) {
+ Context appContext = ContextUtils.getApplicationContext();
+ return FileProvider.getUriForFile(
+ appContext, appContext.getPackageName() + API_AUTHORITY_SUFFIX, file);
}
}

Powered by Google App Engine
This is Rietveld 408576698