Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java |
| index d6b2790b0290e94f69e1754a099d5f91167dd74d..919426ef53e0590e3321c69c3ac4d61b47070a60 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java |
| @@ -190,6 +190,40 @@ public class DownloadController { |
| builder.create().show(); |
| } |
| + /** |
| + * 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 static void enqueueAndroidDownloadManagerRequest(String url, String userAgent, |
| + String fileName, String mimeType, String cookie, String referrer) { |
| + DownloadInfo downloadInfo = new DownloadInfo.Builder() |
| + .setUrl(url) |
| + .setUserAgent(userAgent) |
| + .setFileName(fileName) |
| + .setMimeType(mimeType) |
| + .setCookie(cookie) |
| + .setReferrer(referrer) |
| + .setIsGETRequest(true) |
| + .build(); |
| + enqueueDownloadManagerRequest(downloadInfo); |
| + } |
| + |
| + /** |
| + * Enqueue a request to download a file using Android DownloadManager. |
| + * |
| + * @param info Download information about the download. |
| + */ |
| + static void enqueueDownloadManagerRequest(final DownloadInfo info) { |
|
David Trainor- moved to gerrit
2017/05/17 17:14:03
Should this have the same name as above?
qinmin
2017/05/17 17:50:12
There is an issue with our JNI generator if two fu
|
| + DownloadManagerService.getDownloadManagerService().enqueueDownloadManagerRequest( |
| + new DownloadItem(true, info), true); |
| + } |
| + |
| /** |
| * Called when a download is started. |
| */ |