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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/DownloadInfo.java

Issue 1673183003: add pause button for resumable in-progress downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding assert Created 4 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 | « content/public/android/java/src/org/chromium/content/browser/DownloadController.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/DownloadInfo.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/DownloadInfo.java b/content/public/android/java/src/org/chromium/content/browser/DownloadInfo.java
index 095a3f61c268d49d3d0f266249ad0d8ae2b0e1eb..efa14660eed32e50ce7e641e21d7721378c5a42b 100644
--- a/content/public/android/java/src/org/chromium/content/browser/DownloadInfo.java
+++ b/content/public/android/java/src/org/chromium/content/browser/DownloadInfo.java
@@ -26,6 +26,7 @@ public final class DownloadInfo {
private final int mPercentCompleted;
private final long mTimeRemainingInMillis;
private final boolean mIsResumable;
+ private final boolean mIsPaused;
private DownloadInfo(Builder builder) {
mUrl = builder.mUrl;
@@ -46,6 +47,7 @@ public final class DownloadInfo {
mPercentCompleted = builder.mPercentCompleted;
mTimeRemainingInMillis = builder.mTimeRemainingInMillis;
mIsResumable = builder.mIsResumable;
+ mIsPaused = builder.mIsPaused;
}
public String getUrl() {
@@ -123,6 +125,10 @@ public final class DownloadInfo {
return mIsResumable;
}
+ public boolean isPaused() {
+ return mIsPaused;
+ }
+
/**
* Helper class for building the DownloadInfo object.
*/
@@ -145,6 +151,7 @@ public final class DownloadInfo {
private int mPercentCompleted = -1;
private long mTimeRemainingInMillis;
private boolean mIsResumable = true;
+ private boolean mIsPaused = false;
public Builder setUrl(String url) {
mUrl = url;
@@ -237,6 +244,11 @@ public final class DownloadInfo {
return this;
}
+ public Builder setIsPaused(boolean isPaused) {
+ mIsPaused = isPaused;
+ return this;
+ }
+
public DownloadInfo build() {
return new DownloadInfo(this);
}
@@ -265,7 +277,8 @@ public final class DownloadInfo {
.setIsSuccessful(downloadInfo.isSuccessful())
.setPercentCompleted(downloadInfo.getPercentCompleted())
.setTimeRemainingInMillis(downloadInfo.getTimeRemainingInMillis())
- .setIsResumable(downloadInfo.isResumable());
+ .setIsResumable(downloadInfo.isResumable())
+ .setIsPaused(downloadInfo.isPaused());
return builder;
}
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/DownloadController.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698