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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java

Issue 2631933002: Adding status info to DownloadUIItem and piping it through. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.chrome.browser.offlinepages.downloads; 5 package org.chromium.chrome.browser.offlinepages.downloads;
6 6
7 import android.content.ComponentName; 7 import android.content.ComponentName;
8 import android.support.annotation.Nullable; 8 import android.support.annotation.Nullable;
9 9
10 import org.chromium.base.ObserverList; 10 import org.chromium.base.ObserverList;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 void downloadItemUpdated(OfflinePageDownloadItem item) { 249 void downloadItemUpdated(OfflinePageDownloadItem item) {
250 assert item != null; 250 assert item != null;
251 251
252 for (Observer observer : mObservers) { 252 for (Observer observer : mObservers) {
253 observer.onItemUpdated(item); 253 observer.onItemUpdated(item);
254 } 254 }
255 } 255 }
256 256
257 @CalledByNative 257 @CalledByNative
258 static void createDownloadItemAndAddToList(List<OfflinePageDownloadItem> lis t, String guid, 258 static void createDownloadItemAndAddToList(List<OfflinePageDownloadItem> lis t, String guid,
259 String url, String title, String targetPath, long startTimeMs, long totalBytes) { 259 String url, int downloadState, long downloadProgress, long downloadP rogressMax,
260 list.add(createDownloadItem(guid, url, title, targetPath, startTimeMs, t otalBytes)); 260 String title, String targetPath, long startTimeMs, long totalBytes) {
261 list.add(createDownloadItem(guid, url, downloadState, downloadProgress, downloadProgressMax,
262 title, targetPath, startTimeMs, totalBytes));
261 } 263 }
262 264
263 @CalledByNative 265 @CalledByNative
264 static OfflinePageDownloadItem createDownloadItem( 266 static OfflinePageDownloadItem createDownloadItem(
265 String guid, String url, String title, String targetPath, 267 String guid, String url, int downloadState, long downloadProgress,
266 long startTimeMs, long totalBytes) { 268 long downloadProgressMax, String title, String targetPath, long star tTimeMs,
267 return new OfflinePageDownloadItem(guid, url, title, targetPath, startTi meMs, totalBytes); 269 long totalBytes) {
270 return new OfflinePageDownloadItem(guid, url, downloadState, downloadPro gress,
271 downloadProgressMax, title, targetPath, startTimeMs, totalBytes);
268 } 272 }
269 273
270 private native long nativeInit(Profile profile); 274 private native long nativeInit(Profile profile);
271 private native void nativeDestroy(long nativeOfflinePageDownloadBridge); 275 private native void nativeDestroy(long nativeOfflinePageDownloadBridge);
272 native void nativeGetAllItems( 276 native void nativeGetAllItems(
273 long nativeOfflinePageDownloadBridge, List<OfflinePageDownloadItem> items); 277 long nativeOfflinePageDownloadBridge, List<OfflinePageDownloadItem> items);
274 native OfflinePageDownloadItem nativeGetItemByGuid( 278 native OfflinePageDownloadItem nativeGetItemByGuid(
275 long nativeOfflinePageDownloadBridge, String guid); 279 long nativeOfflinePageDownloadBridge, String guid);
276 native void nativeCancelDownload(long nativeOfflinePageDownloadBridge, Strin g guid); 280 native void nativeCancelDownload(long nativeOfflinePageDownloadBridge, Strin g guid);
277 native void nativePauseDownload(long nativeOfflinePageDownloadBridge, String guid); 281 native void nativePauseDownload(long nativeOfflinePageDownloadBridge, String guid);
278 native void nativeResumeDownload(long nativeOfflinePageDownloadBridge, Strin g guid); 282 native void nativeResumeDownload(long nativeOfflinePageDownloadBridge, Strin g guid);
279 native void nativeDeleteItemByGuid(long nativeOfflinePageDownloadBridge, Str ing guid); 283 native void nativeDeleteItemByGuid(long nativeOfflinePageDownloadBridge, Str ing guid);
280 native long nativeGetOfflineIdByGuid(long nativeOfflinePageDownloadBridge, S tring guid); 284 native long nativeGetOfflineIdByGuid(long nativeOfflinePageDownloadBridge, S tring guid);
281 native void nativeStartDownload(long nativeOfflinePageDownloadBridge, Tab ta b); 285 native void nativeStartDownload(long nativeOfflinePageDownloadBridge, Tab ta b);
282 } 286 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698