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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.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/download/DownloadUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
index e28bcd3c80158d7fe4edbb523ba5c86ec790cfde..5be08cc39d8e74087fc8d0a6f9dccdad0e112131 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
@@ -453,7 +453,7 @@ public class DownloadUtils {
try {
// Try to obtain a content:// URI, which is preferred to a file:// URI so that
// receiving apps don't attempt to determine the file's mime type (which often fails).
- uri = ContentUriUtils.getContentUriFromFile(ContextUtils.getApplicationContext(), file);
+ uri = ContentUriUtils.getContentUriFromFile(file);
} catch (IllegalArgumentException e) {
Log.e(TAG, "Could not create content uri: " + e);
}
@@ -475,7 +475,7 @@ public class DownloadUtils {
public static boolean openFile(
File file, String mimeType, String downloadGuid, boolean isOffTheRecord) {
Context context = ContextUtils.getApplicationContext();
- DownloadManagerService service = DownloadManagerService.getDownloadManagerService(context);
+ DownloadManagerService service = DownloadManagerService.getDownloadManagerService();
// Check if Chrome should open the file itself.
if (service.isDownloadOpenableInBrowser(isOffTheRecord, mimeType)) {

Powered by Google App Engine
This is Rietveld 408576698