OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.download; | 5 package org.chromium.chrome.browser.download; |
6 | 6 |
7 import android.app.DownloadManager; | 7 import android.app.DownloadManager; |
8 import android.content.ActivityNotFoundException; | 8 import android.content.ActivityNotFoundException; |
9 import android.content.BroadcastReceiver; | 9 import android.content.BroadcastReceiver; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 } | 1185 } |
1186 | 1186 |
1187 /** | 1187 /** |
1188 * Called to cancel a download. | 1188 * Called to cancel a download. |
1189 * @param downloadGuid GUID of the download. | 1189 * @param downloadGuid GUID of the download. |
1190 * @param isOffTheRecord Whether the download is off the record. | 1190 * @param isOffTheRecord Whether the download is off the record. |
1191 * @param isNotificationDismissed Whether cancel is caused by dismissing the
notification. | 1191 * @param isNotificationDismissed Whether cancel is caused by dismissing the
notification. |
1192 */ | 1192 */ |
1193 @Override | 1193 @Override |
1194 public void cancelDownload( | 1194 public void cancelDownload( |
1195 String downloadGuid, boolean isOffTheRecord, boolean isNotificationD
ismissed) { | 1195 String downloadGuid, boolean isOffTheRecord) { |
1196 nativeCancelDownload(getNativeDownloadManagerService(), downloadGuid, is
OffTheRecord, | 1196 nativeCancelDownload(getNativeDownloadManagerService(), downloadGuid, is
OffTheRecord); |
1197 isNotificationDismissed); | |
1198 removeDownloadProgress(downloadGuid); | 1197 removeDownloadProgress(downloadGuid); |
1199 recordDownloadFinishedUMA(DOWNLOAD_STATUS_CANCELLED, downloadGuid, 0); | 1198 recordDownloadFinishedUMA(DOWNLOAD_STATUS_CANCELLED, downloadGuid, 0); |
1200 } | 1199 } |
1201 | 1200 |
1202 /** | 1201 /** |
1203 * Called to pause a download. | 1202 * Called to pause a download. |
1204 * @param downloadGuid GUID of the download. | 1203 * @param downloadGuid GUID of the download. |
1205 * @param isOffTheRecord Whether the download is off the record. | 1204 * @param isOffTheRecord Whether the download is off the record. |
1206 */ | 1205 */ |
1207 @Override | 1206 @Override |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 @Override | 1804 @Override |
1806 public void purgeActiveNetworkList(long[] activeNetIds) {} | 1805 public void purgeActiveNetworkList(long[] activeNetIds) {} |
1807 | 1806 |
1808 private static native boolean nativeIsSupportedMimeType(String mimeType); | 1807 private static native boolean nativeIsSupportedMimeType(String mimeType); |
1809 private static native int nativeGetAutoResumptionLimit(); | 1808 private static native int nativeGetAutoResumptionLimit(); |
1810 | 1809 |
1811 private native long nativeInit(); | 1810 private native long nativeInit(); |
1812 private native void nativeResumeDownload( | 1811 private native void nativeResumeDownload( |
1813 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord); | 1812 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord); |
1814 private native void nativeCancelDownload( | 1813 private native void nativeCancelDownload( |
1815 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord, | 1814 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord); |
1816 boolean isNotificationDismissed); | |
1817 private native void nativePauseDownload(long nativeDownloadManagerService, S
tring downloadGuid, | 1815 private native void nativePauseDownload(long nativeDownloadManagerService, S
tring downloadGuid, |
1818 boolean isOffTheRecord); | 1816 boolean isOffTheRecord); |
1819 private native void nativeRemoveDownload(long nativeDownloadManagerService,
String downloadGuid, | 1817 private native void nativeRemoveDownload(long nativeDownloadManagerService,
String downloadGuid, |
1820 boolean isOffTheRecord); | 1818 boolean isOffTheRecord); |
1821 private native void nativeGetAllDownloads( | 1819 private native void nativeGetAllDownloads( |
1822 long nativeDownloadManagerService, boolean isOffTheRecord); | 1820 long nativeDownloadManagerService, boolean isOffTheRecord); |
1823 private native void nativeCheckForExternallyRemovedDownloads( | 1821 private native void nativeCheckForExternallyRemovedDownloads( |
1824 long nativeDownloadManagerService, boolean isOffTheRecord); | 1822 long nativeDownloadManagerService, boolean isOffTheRecord); |
1825 private native void nativeUpdateLastAccessTime( | 1823 private native void nativeUpdateLastAccessTime( |
1826 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord); | 1824 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord); |
1827 } | 1825 } |
OLD | NEW |