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

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

Issue 2493543003: [Downloads] Pass more DownloadItem state to java (Closed)
Patch Set: Removed dependency Created 4 years, 1 month 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/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java » ('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/DownloadInfo.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
index c170ee752a3ec04f61e8a4e7ab72f86c2a1398ff..252aa115a4e4f42507f77f2a1b620175ad73bf20 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
@@ -4,6 +4,8 @@
package org.chromium.chrome.browser.download;
+import org.chromium.content_public.browser.DownloadState;
+
/**
* Class representing the state of a single download.
*/
@@ -28,6 +30,7 @@ public final class DownloadInfo {
private final boolean mIsPaused;
private final boolean mIsOffTheRecord;
private final boolean mIsOfflinePage;
+ private final int mState;
private DownloadInfo(Builder builder) {
mUrl = builder.mUrl;
@@ -50,6 +53,7 @@ public final class DownloadInfo {
mIsPaused = builder.mIsPaused;
mIsOffTheRecord = builder.mIsOffTheRecord;
mIsOfflinePage = builder.mIsOfflinePage;
+ mState = builder.mState;
}
public String getUrl() {
@@ -135,6 +139,10 @@ public final class DownloadInfo {
return mIsOfflinePage;
}
+ public int state() {
+ return mState;
+ }
+
/**
* Helper class for building the DownloadInfo object.
*/
@@ -159,6 +167,7 @@ public final class DownloadInfo {
private boolean mIsPaused;
private boolean mIsOffTheRecord;
private boolean mIsOfflinePage = false;
+ private int mState = DownloadState.IN_PROGRESS;
public Builder setUrl(String url) {
mUrl = url;
@@ -261,6 +270,11 @@ public final class DownloadInfo {
return this;
}
+ public Builder setState(int downloadState) {
+ mState = downloadState;
+ return this;
+ }
+
public DownloadInfo build() {
return new DownloadInfo(this);
}
@@ -291,7 +305,8 @@ public final class DownloadInfo {
.setIsResumable(downloadInfo.isResumable())
.setIsPaused(downloadInfo.isPaused())
.setIsOffTheRecord(downloadInfo.isOffTheRecord())
- .setIsOfflinePage(downloadInfo.isOfflinePage());
+ .setIsOfflinePage(downloadInfo.isOfflinePage())
+ .setState(downloadInfo.state());
return builder;
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698