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

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

Issue 2768953002: Initial work to move downloads to ContentIds (Closed)
Patch Set: Rebase because of a conflict... with a single. import. :( Created 3 years, 9 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: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
index 46f5d090c24ccccb511383f339521b1e4d4b79d8..ec9b4fb1990df5f495ee5d7c53a36dda9abf980b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
@@ -19,6 +19,7 @@ import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.document.AsyncTabCreationParams;
import org.chromium.chrome.browser.tabmodel.document.TabDelegate;
+import org.chromium.components.offline_items_collection.ContentId;
import org.chromium.content_public.browser.LoadUrlParams;
import java.util.ArrayList;
@@ -126,17 +127,17 @@ public class OfflinePageDownloadBridge implements DownloadServiceDelegate, Offli
}
@Override
- public void cancelDownload(String downloadGuid, boolean isOffTheRecord) {
- cancelDownload(downloadGuid);
+ public void cancelDownload(ContentId id, boolean isOffTheRecord) {
+ cancelDownload(id.id);
}
@Override
- public void pauseDownload(String downloadGuid, boolean isOffTheRecord) {
- pauseDownload(downloadGuid);
+ public void pauseDownload(ContentId id, boolean isOffTheRecord) {
+ pauseDownload(id.id);
}
@Override
- public void resumeDownload(DownloadItem item, boolean hasUserGesture) {
+ public void resumeDownload(ContentId id, DownloadItem item, boolean hasUserGesture) {
// If the resumption was an user action then we have to resume the specific download item.
// Otherwise it can only be called when Chrome starts and we would like to resume all
// pending requests.
@@ -227,16 +228,16 @@ public class OfflinePageDownloadBridge implements DownloadServiceDelegate, Offli
/**
* Waits for the download items to get loaded and opens the offline page identified by the GUID.
- * @param GUID of the item to open.
+ * @param id The {@link ContentId} of the page to open.
*/
- public static void openDownloadedPage(final String guid) {
+ public static void openDownloadedPage(final ContentId id) {
final OfflinePageDownloadBridge bridge =
new OfflinePageDownloadBridge(Profile.getLastUsedProfile());
bridge.addObserver(
new Observer() {
@Override
public void onItemsLoaded() {
- bridge.openItem(guid, null);
+ bridge.openItem(id.id, null);
bridge.destroyServiceDelegate();
}
});

Powered by Google App Engine
This is Rietveld 408576698