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

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

Issue 2642683005: reintroduce InterceptDownloadResourceThrottle for some OMA DRM downloads (Closed)
Patch Set: function name change to avoid findbugs confusion Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
index 437c88db1bf0a4a71898d48432b6985a9a72e946..0b99b219a9a289cdb1f0104dd402fa6415f43ebb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
@@ -311,6 +311,30 @@ public class ChromeDownloadDelegate {
}
/**
+ * Enqueue a request to download a file using Android DownloadManager.
+ * @param url Url to download.
+ * @param userAgent User agent to use.
+ * @param contentDisposition Content disposition of the request.
+ * @param mimeType MIME type.
+ * @param cookie Cookie to use.
+ * @param referrer Referrer to use.
+ */
+ @CalledByNative
+ private void enqueueAndroidDownloadManagerRequest(String url, String userAgent,
+ String contentDisposition, String mimeType, String cookie, String referrer) {
+ DownloadInfo downloadInfo = new DownloadInfo.Builder()
+ .setUrl(url)
+ .setUserAgent(userAgent)
+ .setContentDisposition(contentDisposition)
+ .setMimeType(mimeType)
+ .setCookie(cookie)
+ .setReferrer(referrer)
+ .setIsGETRequest(true)
+ .build();
+ enqueueDownloadManagerRequest(downloadInfo);
+ }
+
+ /**
* Called when download starts.
*
* @param filename Name of the file.
« no previous file with comments | « no previous file | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698