Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java |
| index 3ac4657dabdb9cb95e2462408573cde1dc765902..ffe1726cef2b7bdfe55c331d035f22030e9a1237 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java |
| @@ -6,7 +6,16 @@ package org.chromium.chrome.browser.offlinepages.downloads; |
| /** Class representing offline page or save page request to downloads UI. */ |
| public class OfflinePageDownloadItem { |
| + /** Download State, in sync with DownloadUIItem::DownloadState */ |
|
fgorski
2017/01/20 17:03:01
There is a way to enforce that using compiler. For
gone
2017/01/20 18:40:01
Alternatively, can you just use org.chromium.conte
Dmitry Titov
2017/01/27 04:26:24
Can not include content/public/browser stuff in al
|
| + private static final int PENDING = 0; |
| + private static final int DOWNLOADING = 1; |
| + private static final int PAUSED = 2; |
| + private static final int COMPLETED = 3; |
| + |
| private final String mUrl; |
| + private final int mDownloadState; |
| + private final long mDownloadProgress; |
| + private final long mDownloadProgressMax; |
| private final String mTitle; |
| private final String mGuid; |
| private final String mTargetPath; |
| @@ -14,10 +23,14 @@ public class OfflinePageDownloadItem { |
| private final long mTotalBytes; |
| public OfflinePageDownloadItem( |
| - String guid, String url, String title, String targetPath, |
| + String guid, String url, int downloadState, long downloadProgress, |
| + long downloadProgressMax, String title, String targetPath, |
| long startTimeMs, long totalBytes) { |
| mGuid = guid; |
| mUrl = url; |
| + mDownloadState = downloadState; |
| + mDownloadProgress = downloadProgress; |
| + mDownloadProgressMax = downloadProgressMax; |
| mTitle = title; |
| mTargetPath = targetPath; |
| mStartTimeMs = startTimeMs; |
| @@ -34,6 +47,21 @@ public class OfflinePageDownloadItem { |
| return mUrl; |
| } |
| + /** @return DownloadState value. */ |
| + public int downloadState() { |
| + return mDownloadState; |
| + } |
| + |
| + /** @return current download progress */ |
| + public long downloadPreogress() { |
|
dewittj
2017/01/18 19:24:07
s/Preogress/Progress/ also in next function
Dmitry Titov
2017/01/27 04:26:24
Done.
|
| + return mDownloadProgress; |
| + } |
| + |
| + /** @return current download progress */ |
| + public long downloadPreogressMax() { |
| + return mDownloadProgressMax; |
| + } |
| + |
| /** @return Title of the page. */ |
| public String getTitle() { |
| return mTitle; |