Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| index 08fe717dcf4eebe028ba1965eec77e213f6a5d05..e518fd3332e0a76f2e2b99c957e55b4b39883c92 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| @@ -70,20 +70,22 @@ public class OfflinePageNotificationBridge { |
| * @param displayName Name to be displayed on notification. |
| */ |
| @CalledByNative |
| - public static void notifyDownloadProgress( |
| - Context context, String guid, String url, long startTime, String displayName) { |
| + public static void notifyDownloadProgress(Context context, String guid, String url, |
| + long startTime, long bytesReceived, String displayName) { |
| DownloadNotifier notifier = getDownloadNotifier(context); |
| if (notifier == null) return; |
| - // Use -1 percentage for interdeterminate progress bar (until we have better value). |
| - // TODO(qinmin): get the download percentage from native code, |
| - int percentage = -1; |
| + // To signal 'indeterminate' progress that doesn't have percentage value. |
|
fgorski
2017/03/07 22:26:43
... this comment would probably not be necessary t
Dmitry Titov
2017/03/08 00:47:38
Done.
|
| + // UI is using a different style of progress bar if that is the case. |
| + int percentage = |
| + org.chromium.chrome.browser.download.DownloadItem.INVALID_DOWNLOAD_PERCENTAGE; |
| DownloadInfo downloadInfo = new DownloadInfo.Builder() |
| .setIsOfflinePage(true) |
| .setDownloadGuid(guid) |
| .setFileName(displayName) |
| .setFilePath(url) |
| .setPercentCompleted(percentage) |
| + .setBytesReceived(bytesReceived) |
| .setIsOffTheRecord(false) |
| .setIsResumable(true) |
| .setTimeRemainingInMillis(0) |