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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java

Issue 2493543003: [Downloads] Pass more DownloadItem state to java (Closed)
Patch Set: Removed dependency Created 4 years, 1 month 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/download/ui/DownloadHistoryAdapter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java
index 9a7ccc5cde77f48e32f25365e69c31bdf5a4801c..dd44abfbe504c3e3513366e284b758ab6b6327f5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java
@@ -121,6 +121,9 @@ public class DownloadHistoryAdapter extends DateDividedAdapter implements Downlo
for (DownloadItem item : result) {
DownloadItemWrapper wrapper = createDownloadItemWrapper(item, isOffTheRecord);
+ // Don't display any incomplete downloads, yet.
+ if (item.getDownloadInfo().state() != DownloadState.COMPLETE) continue;
+
// TODO(twellington): The native downloads service should remove externally deleted
// downloads rather than passing them to Java.
if (getExternallyDeletedItemsMap(isOffTheRecord).containsKey(wrapper.getId())) {
@@ -207,11 +210,11 @@ public class DownloadHistoryAdapter extends DateDividedAdapter implements Downlo
/**
* Updates the list when new information about a download comes in.
*/
- public void onDownloadItemUpdated(DownloadItem item, boolean isOffTheRecord, int state) {
+ public void onDownloadItemUpdated(DownloadItem item, boolean isOffTheRecord) {
if (isOffTheRecord && !mShowOffTheRecord) return;
// The adapter currently only cares about completion events.
- if (state != DownloadState.COMPLETE) return;
+ if (item.getDownloadInfo().state() != DownloadState.COMPLETE) return;
List<DownloadItemWrapper> list = getDownloadItemList(isOffTheRecord);
int index = findItemIndex(list, item.getId());

Powered by Google App Engine
This is Rietveld 408576698