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

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

Issue 2239133002: [Offline pages] Downloads UI: Adding bridge for issuing notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@download-notifications
Patch Set: Minimizing the patch to handle direct WC capture on download button Created 4 years, 4 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 922ab83409b00a6ab41f458ae83ff8b7288ba5b1..ac4cf0a15a1d220fd26474441fa92e075755a5c9 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
@@ -69,6 +69,11 @@ public class OfflinePageDownloadBridge implements DownloadServiceDelegate {
* Gets DownloadServiceDelegate that is suitable for interacting with offline download items.
*/
public static DownloadServiceDelegate getDownloadServiceDelegate() {
+ return createDefault();
fgorski 2016/08/18 22:59:51 these 4 lines to be removed
fgorski 2016/08/19 17:03:24 Done.
+ }
+
+ /** Creates the bridge for the last used profile. */
+ public static OfflinePageDownloadBridge createDefault() {
return new OfflinePageDownloadBridge(Profile.getLastUsedProfile());
}
@@ -147,10 +152,16 @@ public class OfflinePageDownloadBridge implements DownloadServiceDelegate {
/**
* See {@link #openItem(String, ComponentName)}.
*/
+ @Override
public void openItem(String guid) {
openItem(guid, null);
}
+ @Override
+ public void destroyServiceDelegate() {
+ destroy();
+ }
+
/**
* 'Opens' the offline page identified by the GUID.
* This is done by creating a new tab and navigating it to the saved local snapshot.

Powered by Google App Engine
This is Rietveld 408576698