summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/downloads/content/downloads.js
diff options
context:
space:
mode:
Diffstat (limited to 'application/palemoon/components/downloads/content/downloads.js')
-rw-r--r--application/palemoon/components/downloads/content/downloads.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/application/palemoon/components/downloads/content/downloads.js b/application/palemoon/components/downloads/content/downloads.js
index 199324b6b..b36b9d0fe 100644
--- a/application/palemoon/components/downloads/content/downloads.js
+++ b/application/palemoon/components/downloads/content/downloads.js
@@ -4,6 +4,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
+
+XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
+ "resource:///modules/DownloadsCommon.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "DownloadsViewUI",
+ "resource:///modules/DownloadsViewUI.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
+ "resource://gre/modules/FileUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
+ "resource://gre/modules/NetUtil.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
+ "resource://gre/modules/PlacesUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Services",
+ "resource://gre/modules/Services.jsm");
+
/**
* Handles the Downloads panel user interface for each browser window.
*
@@ -1066,7 +1081,7 @@ function DownloadsViewItem(download, aElement) {
}
DownloadsViewItem.prototype = {
- __proto__: DownloadElementShell.prototype,
+ __proto__: DownloadsViewUI.DownloadElementShell.prototype,
/**
* The XUL element corresponding to the associated richlistbox item.
@@ -1253,10 +1268,7 @@ DownloadsViewItemController.prototype = {
commands: {
cmd_delete: function DVIC_cmd_delete()
{
- Downloads.getList(Downloads.ALL)
- .then(list => list.remove(this.download))
- .then(() => this.download.finalize(true))
- .catch(Cu.reportError);
+ DownloadsCommon.removeAndFinalizeDownload(this.download);
PlacesUtils.bhistory.removePage(
NetUtil.newURI(this.download.source.url));
},