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

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

Issue 2160063002: Allow user to pause/resume incognito downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix clang warning Created 4 years, 5 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/SystemDownloadNotifier.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java b/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java
index 5b54ed68beeca5e2d10bd719dab92cae0c262e69..4d37e4d861b583e9f496474008ee8cb670503ade 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java
@@ -34,6 +34,7 @@ public class SystemDownloadNotifier implements DownloadNotifier {
private static final int DOWNLOAD_NOTIFICATION_TYPE_CANCEL = 3;
private static final int DOWNLOAD_NOTIFICATION_TYPE_RESUME_ALL = 4;
private static final int DOWNLOAD_NOTIFICATION_TYPE_PAUSE = 5;
+ private static final int DOWNLOAD_NOTIFICATION_TYPE_INTERRUPT = 6;
private final Context mApplicationContext;
private final Object mLock = new Object();
@Nullable private DownloadNotificationService mBoundService;
@@ -204,9 +205,16 @@ public class SystemDownloadNotifier implements DownloadNotifier {
}
@Override
- public void notifyDownloadPaused(DownloadInfo downloadInfo, boolean isAutoResumable) {
+ public void notifyDownloadPaused(DownloadInfo downloadInfo) {
PendingNotificationInfo info =
new PendingNotificationInfo(DOWNLOAD_NOTIFICATION_TYPE_PAUSE, downloadInfo);
+ updateDownloadNotification(info);
+ }
+
+ @Override
+ public void notifyDownloadInterrupted(DownloadInfo downloadInfo, boolean isAutoResumable) {
+ PendingNotificationInfo info =
+ new PendingNotificationInfo(DOWNLOAD_NOTIFICATION_TYPE_INTERRUPT, downloadInfo);
info.isAutoResumable = isAutoResumable;
updateDownloadNotification(info);
}
@@ -261,13 +269,16 @@ public class SystemDownloadNotifier implements DownloadNotifier {
mBoundService.notifyDownloadProgress(
info.getDownloadGuid(), info.getFileName(),
info.getPercentCompleted(), info.getTimeRemainingInMillis(),
- notificationInfo.startTime, info.isResumable(),
+ notificationInfo.startTime, info.isOffTheRecord(),
notificationInfo.canDownloadWhileMetered);
break;
case DOWNLOAD_NOTIFICATION_TYPE_PAUSE:
- assert info.isResumable();
+ mBoundService.notifyDownloadPaused(info.getDownloadGuid(), true, false);
+ break;
+ case DOWNLOAD_NOTIFICATION_TYPE_INTERRUPT:
mBoundService.notifyDownloadPaused(
- info.getDownloadGuid(), notificationInfo.isAutoResumable);
+ info.getDownloadGuid(), info.isResumable(),
+ notificationInfo.isAutoResumable);
break;
case DOWNLOAD_NOTIFICATION_TYPE_SUCCESS:
final int notificationId = mBoundService.notifyDownloadSuccessful(

Powered by Google App Engine
This is Rietveld 408576698