OLD | NEW |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 */ | 53 */ |
54 public void onItemDeleted(String guid) {} | 54 public void onItemDeleted(String guid) {} |
55 | 55 |
56 /** | 56 /** |
57 * Event fired when an new item was updated. | 57 * Event fired when an new item was updated. |
58 * @param item A newly updated download item. | 58 * @param item A newly updated download item. |
59 */ | 59 */ |
60 public void onItemUpdated(OfflinePageDownloadItem item) {} | 60 public void onItemUpdated(OfflinePageDownloadItem item) {} |
61 } | 61 } |
62 | 62 |
63 private static boolean sIsTesting = false; | 63 private static boolean sIsTesting; |
64 private final ObserverList<Observer> mObservers = new ObserverList<Observer>
(); | 64 private final ObserverList<Observer> mObservers = new ObserverList<Observer>
(); |
65 private long mNativeOfflinePageDownloadBridge; | 65 private long mNativeOfflinePageDownloadBridge; |
66 private boolean mIsLoaded; | 66 private boolean mIsLoaded; |
67 | 67 |
68 /** | 68 /** |
69 * Gets DownloadServiceDelegate that is suitable for interacting with offlin
e download items. | 69 * Gets DownloadServiceDelegate that is suitable for interacting with offlin
e download items. |
70 */ | 70 */ |
71 public static DownloadServiceDelegate getDownloadServiceDelegate() { | 71 public static DownloadServiceDelegate getDownloadServiceDelegate() { |
72 return new OfflinePageDownloadBridge(Profile.getLastUsedProfile()); | 72 return new OfflinePageDownloadBridge(Profile.getLastUsedProfile()); |
73 } | 73 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 long nativeOfflinePageDownloadBridge, List<OfflinePageDownloadItem>
items); | 273 long nativeOfflinePageDownloadBridge, List<OfflinePageDownloadItem>
items); |
274 native OfflinePageDownloadItem nativeGetItemByGuid( | 274 native OfflinePageDownloadItem nativeGetItemByGuid( |
275 long nativeOfflinePageDownloadBridge, String guid); | 275 long nativeOfflinePageDownloadBridge, String guid); |
276 native void nativeCancelDownload(long nativeOfflinePageDownloadBridge, Strin
g guid); | 276 native void nativeCancelDownload(long nativeOfflinePageDownloadBridge, Strin
g guid); |
277 native void nativePauseDownload(long nativeOfflinePageDownloadBridge, String
guid); | 277 native void nativePauseDownload(long nativeOfflinePageDownloadBridge, String
guid); |
278 native void nativeResumeDownload(long nativeOfflinePageDownloadBridge, Strin
g guid); | 278 native void nativeResumeDownload(long nativeOfflinePageDownloadBridge, Strin
g guid); |
279 native void nativeDeleteItemByGuid(long nativeOfflinePageDownloadBridge, Str
ing guid); | 279 native void nativeDeleteItemByGuid(long nativeOfflinePageDownloadBridge, Str
ing guid); |
280 native long nativeGetOfflineIdByGuid(long nativeOfflinePageDownloadBridge, S
tring guid); | 280 native long nativeGetOfflineIdByGuid(long nativeOfflinePageDownloadBridge, S
tring guid); |
281 native void nativeStartDownload(long nativeOfflinePageDownloadBridge, Tab ta
b); | 281 native void nativeStartDownload(long nativeOfflinePageDownloadBridge, Tab ta
b); |
282 } | 282 } |
OLD | NEW |