OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.components.offline_items_collection.bridges; | 5 package org.chromium.components.offline_items_collection.bridges; |
6 | 6 |
7 import org.chromium.base.annotations.CalledByNative; | 7 import org.chromium.base.annotations.CalledByNative; |
8 import org.chromium.base.annotations.JNINamespace; | 8 import org.chromium.base.annotations.JNINamespace; |
9 import org.chromium.components.offline_items_collection.OfflineItem; | 9 import org.chromium.components.offline_items_collection.OfflineItem; |
10 import org.chromium.components.offline_items_collection.OfflineItemFilter; | 10 import org.chromium.components.offline_items_collection.OfflineItemFilter; |
11 import org.chromium.components.offline_items_collection.OfflineItemState; | 11 import org.chromium.components.offline_items_collection.OfflineItemState; |
David Trainor- moved to gerrit
2017/05/03 22:06:32
Add import org.chromium.components.offline_items_c
shaktisahu
2017/05/05 02:09:37
Done.
| |
12 | 12 |
13 import java.util.ArrayList; | 13 import java.util.ArrayList; |
14 | 14 |
15 /** | 15 /** |
16 * The Java counterpart to the C++ class OfflineItemBridge | 16 * The Java counterpart to the C++ class OfflineItemBridge |
17 * (components/offline_items_collection/core/android/offline_item_bridge.h). Th is class has no | 17 * (components/offline_items_collection/core/android/offline_item_bridge.h). Th is class has no |
18 * public members or methods and is meant as a private factory to build {@link O fflineItem} | 18 * public members or methods and is meant as a private factory to build {@link O fflineItem} |
19 * instances. | 19 * instances. |
20 */ | 20 */ |
21 @JNINamespace("offline_items_collection::android") | 21 @JNINamespace("offline_items_collection::android") |
(...skipping 17 matching lines...) Expand all Loading... | |
39 * @param list An {@link ArrayList} to optionally add the newly created {@li nk OfflineItem} to. | 39 * @param list An {@link ArrayList} to optionally add the newly created {@li nk OfflineItem} to. |
40 * @return The newly created {@link OfflineItem} based on the passed in para meters. | 40 * @return The newly created {@link OfflineItem} based on the passed in para meters. |
41 */ | 41 */ |
42 @CalledByNative | 42 @CalledByNative |
43 private static OfflineItem createOfflineItemAndMaybeAddToList(ArrayList<Offl ineItem> list, | 43 private static OfflineItem createOfflineItemAndMaybeAddToList(ArrayList<Offl ineItem> list, |
44 String nameSpace, String id, String title, String description, | 44 String nameSpace, String id, String title, String description, |
45 @OfflineItemFilter int filter, boolean isTransient, long totalSizeBy tes, | 45 @OfflineItemFilter int filter, boolean isTransient, long totalSizeBy tes, |
46 boolean externallyRemoved, long creationTimeMs, long lastAccessedTim eMs, | 46 boolean externallyRemoved, long creationTimeMs, long lastAccessedTim eMs, |
47 boolean isOpenable, String pageUrl, String originalUrl, boolean isOf fTheRecord, | 47 boolean isOpenable, String pageUrl, String originalUrl, boolean isOf fTheRecord, |
48 @OfflineItemState int state, boolean isResumable, boolean allowMeter ed, | 48 @OfflineItemState int state, boolean isResumable, boolean allowMeter ed, |
49 long receivedBytes, int percentCompleted, long timeRemainingMs) { | 49 long receivedBytes, long progressValue, long progressMax, int progre ssUnit, |
David Trainor- moved to gerrit
2017/05/03 22:06:32
Add @OfflineItemProgressUnit before "int progressU
shaktisahu
2017/05/05 02:09:37
Done.
| |
50 long timeRemainingMs) { | |
50 OfflineItem item = new OfflineItem(); | 51 OfflineItem item = new OfflineItem(); |
51 item.id.namespace = nameSpace; | 52 item.id.namespace = nameSpace; |
52 item.id.id = id; | 53 item.id.id = id; |
53 item.title = title; | 54 item.title = title; |
54 item.description = description; | 55 item.description = description; |
55 item.filter = filter; | 56 item.filter = filter; |
56 item.isTransient = isTransient; | 57 item.isTransient = isTransient; |
57 item.totalSizeBytes = totalSizeBytes; | 58 item.totalSizeBytes = totalSizeBytes; |
58 item.externallyRemoved = externallyRemoved; | 59 item.externallyRemoved = externallyRemoved; |
59 item.creationTimeMs = creationTimeMs; | 60 item.creationTimeMs = creationTimeMs; |
60 item.lastAccessedTimeMs = lastAccessedTimeMs; | 61 item.lastAccessedTimeMs = lastAccessedTimeMs; |
61 item.isOpenable = isOpenable; | 62 item.isOpenable = isOpenable; |
62 item.pageUrl = pageUrl; | 63 item.pageUrl = pageUrl; |
63 item.originalUrl = originalUrl; | 64 item.originalUrl = originalUrl; |
64 item.isOffTheRecord = isOffTheRecord; | 65 item.isOffTheRecord = isOffTheRecord; |
65 item.state = state; | 66 item.state = state; |
66 item.isResumable = isResumable; | 67 item.isResumable = isResumable; |
67 item.allowMetered = allowMetered; | 68 item.allowMetered = allowMetered; |
68 item.receivedBytes = receivedBytes; | 69 item.receivedBytes = receivedBytes; |
69 item.percentCompleted = percentCompleted; | 70 item.progress = new OfflineItem.Progress(progressValue, progressMax, pro gressUnit); |
70 item.timeRemainingMs = timeRemainingMs; | 71 item.timeRemainingMs = timeRemainingMs; |
71 | 72 |
72 if (list != null) list.add(item); | 73 if (list != null) list.add(item); |
73 return item; | 74 return item; |
74 } | 75 } |
75 } | 76 } |
OLD | NEW |