Issue #65 - Remove AppConstants from toolkit/components/jsdownloads

This commit is contained in:
Matt A. Tobin 2020-02-06 08:31:14 -05:00 • committed by Roy Tam
commit 0cd01bac24
3 changed files with 18 additions and 17 deletions

View file

@ -28,8 +28,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown", XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
"resource://gre/modules/AsyncShutdown.jsm"); "resource://gre/modules/AsyncShutdown.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
"resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask", XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
"resource://gre/modules/DeferredTask.jsm"); "resource://gre/modules/DeferredTask.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Downloads", XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
@ -696,8 +695,11 @@ this.DownloadIntegration = {
fileExtension = match[1]; fileExtension = match[1];
} }
let isWindowsExe = AppConstants.platform == "win" && #ifdef XP_WIN
fileExtension.toLowerCase() == "exe"; let isWindowsExe = fileExtension.toLowerCase() == "exe";
#else
let isWindowsExe = false;
#endif
// Ask for confirmation if the file is executable, except for .exe on // Ask for confirmation if the file is executable, except for .exe on
// Windows where the operating system will show the prompt based on the // Windows where the operating system will show the prompt based on the

View file

@ -22,7 +22,6 @@ const Cu = Components.utils;
const Cr = Components.results; const Cr = Components.results;
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OS", XPCOMUtils.defineLazyModuleGetter(this, "OS",
"resource://gre/modules/osfile.jsm"); "resource://gre/modules/osfile.jsm");
@ -186,17 +185,17 @@ this.DownloadPrompter.prototype = {
switch (aPromptType) { switch (aPromptType) {
case this.ON_QUIT: case this.ON_QUIT:
title = s.quitCancelDownloadsAlertTitle; title = s.quitCancelDownloadsAlertTitle;
if (AppConstants.platform != "macosx") { #ifdef XP_MACOSX
message = aDownloadsCount > 1 message = aDownloadsCount > 1
? s.quitCancelDownloadsAlertMsgMultiple(aDownloadsCount) ? s.quitCancelDownloadsAlertMsgMacMultiple(aDownloadsCount)
: s.quitCancelDownloadsAlertMsg; : s.quitCancelDownloadsAlertMsgMac;
cancelButton = s.dontQuitButtonWin; cancelButton = s.dontQuitButtonMac;
} else { #else
message = aDownloadsCount > 1 message = aDownloadsCount > 1
? s.quitCancelDownloadsAlertMsgMacMultiple(aDownloadsCount) ? s.quitCancelDownloadsAlertMsgMultiple(aDownloadsCount)
: s.quitCancelDownloadsAlertMsgMac; : s.quitCancelDownloadsAlertMsg;
cancelButton = s.dontQuitButtonMac; cancelButton = s.dontQuitButtonWin;
} #endif
break; break;
case this.ON_OFFLINE: case this.ON_OFFLINE:
title = s.offlineCancelDownloadsAlertTitle; title = s.offlineCancelDownloadsAlertTitle;

View file

@ -19,11 +19,11 @@ EXTRA_JS_MODULES += [
'DownloadList.jsm', 'DownloadList.jsm',
'Downloads.jsm', 'Downloads.jsm',
'DownloadStore.jsm', 'DownloadStore.jsm',
'DownloadUIHelper.jsm',
] ]
EXTRA_PP_JS_MODULES += [ EXTRA_PP_JS_MODULES += [
'DownloadIntegration.jsm', 'DownloadIntegration.jsm',
'DownloadUIHelper.jsm',
] ]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'