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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java

Issue 2736843002: Fix the Download Notifications for Offline Pages to indicate bytes loaded. (Closed)
Patch Set: fix typo Created 3 years, 9 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
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)

Powered by Google App Engine
This is Rietveld 408576698