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

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: more fixes to more tests. 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..2f132b63ae2fe757ce71e7a7aaf8da26cf5f5d81 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,20 @@ 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;
+ int percentage =
+ org.chromium.chrome.browser.download.DownloadItem.INDETERMINATE_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