summaryrefslogtreecommitdiffstats
path: root/toolkit/components/jsdownloads
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-02-07 10:57:04 +0100
committerGitHub <noreply@github.com>2020-02-07 10:57:04 +0100
commit6c82d043a1fbcda650057467ae2858025290ed25 (patch)
tree0e6ed8ca0a0d12653351c67d8de62a372c954f29 /toolkit/components/jsdownloads
parenta6ef90b1830e263fefda7bcb6e7b74464044a678 (diff)
parentfa52fa60b70c5883acd4a8edd8e1f89c3d5f3920 (diff)
downloadUXP-6c82d043a1fbcda650057467ae2858025290ed25.tar
UXP-6c82d043a1fbcda650057467ae2858025290ed25.tar.gz
UXP-6c82d043a1fbcda650057467ae2858025290ed25.tar.lz
UXP-6c82d043a1fbcda650057467ae2858025290ed25.tar.xz
UXP-6c82d043a1fbcda650057467ae2858025290ed25.zip
Merge pull request #1394 from MoonchildProductions/appconst-work
The rest of removing AppConstants for Platform
Diffstat (limited to 'toolkit/components/jsdownloads')
-rw-r--r--toolkit/components/jsdownloads/src/DownloadIntegration.jsm10
-rw-r--r--toolkit/components/jsdownloads/src/DownloadUIHelper.jsm23
-rw-r--r--toolkit/components/jsdownloads/src/moz.build2
3 files changed, 18 insertions, 17 deletions
diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
index a6875ec48..995cc0669 100644
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -28,8 +28,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
"resource://gre/modules/AsyncShutdown.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
+
XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
"resource://gre/modules/DeferredTask.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
@@ -696,8 +695,11 @@ this.DownloadIntegration = {
fileExtension = match[1];
}
- let isWindowsExe = AppConstants.platform == "win" &&
- fileExtension.toLowerCase() == "exe";
+#ifdef XP_WIN
+ let isWindowsExe = fileExtension.toLowerCase() == "exe";
+#else
+ let isWindowsExe = false;
+#endif
// Ask for confirmation if the file is executable, except for .exe on
// Windows where the operating system will show the prompt based on the
diff --git a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
index ce165205b..d4ce248e3 100644
--- a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
@@ -22,7 +22,6 @@ const Cu = Components.utils;
const Cr = Components.results;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OS",
"resource://gre/modules/osfile.jsm");
@@ -186,17 +185,17 @@ this.DownloadPrompter.prototype = {
switch (aPromptType) {
case this.ON_QUIT:
title = s.quitCancelDownloadsAlertTitle;
- if (AppConstants.platform != "macosx") {
- message = aDownloadsCount > 1
- ? s.quitCancelDownloadsAlertMsgMultiple(aDownloadsCount)
- : s.quitCancelDownloadsAlertMsg;
- cancelButton = s.dontQuitButtonWin;
- } else {
- message = aDownloadsCount > 1
- ? s.quitCancelDownloadsAlertMsgMacMultiple(aDownloadsCount)
- : s.quitCancelDownloadsAlertMsgMac;
- cancelButton = s.dontQuitButtonMac;
- }
+#ifdef XP_MACOSX
+ message = aDownloadsCount > 1
+ ? s.quitCancelDownloadsAlertMsgMacMultiple(aDownloadsCount)
+ : s.quitCancelDownloadsAlertMsgMac;
+ cancelButton = s.dontQuitButtonMac;
+#else
+ message = aDownloadsCount > 1
+ ? s.quitCancelDownloadsAlertMsgMultiple(aDownloadsCount)
+ : s.quitCancelDownloadsAlertMsg;
+ cancelButton = s.dontQuitButtonWin;
+#endif
break;
case this.ON_OFFLINE:
title = s.offlineCancelDownloadsAlertTitle;
diff --git a/toolkit/components/jsdownloads/src/moz.build b/toolkit/components/jsdownloads/src/moz.build
index 87abed62e..ac3768208 100644
--- a/toolkit/components/jsdownloads/src/moz.build
+++ b/toolkit/components/jsdownloads/src/moz.build
@@ -19,11 +19,11 @@ EXTRA_JS_MODULES += [
'DownloadList.jsm',
'Downloads.jsm',
'DownloadStore.jsm',
- 'DownloadUIHelper.jsm',
]
EXTRA_PP_JS_MODULES += [
'DownloadIntegration.jsm',
+ 'DownloadUIHelper.jsm',
]
FINAL_LIBRARY = 'xul'