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 */ |
| + 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() { |
|
Pete Williamson
2017/01/17 18:27:34
nit- Preogress -> Progress (and again further down
Dmitry Titov
2017/01/27 04:30:22
Done.
|
| + return mDownloadProgress; |
| + } |
| + |
| + /** @return current download progress */ |
| + public long downloadPreogressMax() { |
| + return mDownloadProgressMax; |
| + } |
| + |
| /** @return Title of the page. */ |
| public String getTitle() { |
| return mTitle; |