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

Unified Diff: components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemBridge.java

Issue 2861863002: offline_items_collection : Added helper class to determine progress (Closed)
Patch Set: comments Created 3 years, 7 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: components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemBridge.java
diff --git a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemBridge.java b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemBridge.java
index 7f4309741a4ca8bdc5b33bbb7c65a421d6529f04..1b99def32a62c5e709ba3f83725ea7a5be72486e 100644
--- a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemBridge.java
+++ b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemBridge.java
@@ -8,6 +8,7 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.components.offline_items_collection.OfflineItem;
import org.chromium.components.offline_items_collection.OfflineItemFilter;
+import org.chromium.components.offline_items_collection.OfflineItemProgressUnit;
import org.chromium.components.offline_items_collection.OfflineItemState;
import java.util.ArrayList;
@@ -46,7 +47,8 @@ public final class OfflineItemBridge {
boolean externallyRemoved, long creationTimeMs, long lastAccessedTimeMs,
boolean isOpenable, String pageUrl, String originalUrl, boolean isOffTheRecord,
@OfflineItemState int state, boolean isResumable, boolean allowMetered,
- long receivedBytes, int percentCompleted, long timeRemainingMs) {
+ long receivedBytes, long progressValue, long progressMax,
+ @OfflineItemProgressUnit int progressUnit, long timeRemainingMs) {
OfflineItem item = new OfflineItem();
item.id.namespace = nameSpace;
item.id.id = id;
@@ -66,7 +68,8 @@ public final class OfflineItemBridge {
item.isResumable = isResumable;
item.allowMetered = allowMetered;
item.receivedBytes = receivedBytes;
- item.percentCompleted = percentCompleted;
+ item.progress = new OfflineItem.Progress(
+ progressValue, progressMax == -1 ? null : progressMax, progressUnit);
item.timeRemainingMs = timeRemainingMs;
if (list != null) list.add(item);

Powered by Google App Engine
This is Rietveld 408576698