diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-06 06:32:11 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:37:44 +0200 |
commit | 4e58dab0a13b4dc61f5849b11cb81c6c53402536 (patch) | |
tree | 479a99e9f7fcd3046f6834464c141a0d198b3dc5 /toolkit/mozapps/downloads/content | |
parent | 9e42d9ea2f36633eeb1447ad9980495e3d00b40f (diff) | |
download | UXP-4e58dab0a13b4dc61f5849b11cb81c6c53402536.tar UXP-4e58dab0a13b4dc61f5849b11cb81c6c53402536.tar.gz UXP-4e58dab0a13b4dc61f5849b11cb81c6c53402536.tar.lz UXP-4e58dab0a13b4dc61f5849b11cb81c6c53402536.tar.xz UXP-4e58dab0a13b4dc61f5849b11cb81c6c53402536.zip |
Issue #65 - Remove AppConstants from toolkit/mozapps/downloads
Diffstat (limited to 'toolkit/mozapps/downloads/content')
-rw-r--r-- | toolkit/mozapps/downloads/content/downloads.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/toolkit/mozapps/downloads/content/downloads.js b/toolkit/mozapps/downloads/content/downloads.js index 2fdb19a74..66230592f 100644 --- a/toolkit/mozapps/downloads/content/downloads.js +++ b/toolkit/mozapps/downloads/content/downloads.js @@ -19,7 +19,6 @@ var Cu = Components.utils; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/DownloadUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/AppConstants.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); @@ -253,18 +252,18 @@ function openDownload(aDownload) dontAsk = !pref.getBoolPref(PREF_BDM_CONFIRMOPENEXE); } catch (e) { } - if (AppConstants.platform == "win") { - // On Vista and above, we rely on native security prompting for - // downloaded content unless it's disabled. - try { - var sysInfo = Cc["@mozilla.org/system-info;1"]. - getService(Ci.nsIPropertyBag2); - if (parseFloat(sysInfo.getProperty("version")) >= 6 && - pref.getBoolPref(PREF_BDM_SCANWHENDONE)) { - dontAsk = true; - } - } catch (ex) { } - } +#ifdef XP_WIN + // On Vista and above, we rely on native security prompting for + // downloaded content unless it's disabled. + try { + var sysInfo = Cc["@mozilla.org/system-info;1"]. + getService(Ci.nsIPropertyBag2); + if (parseFloat(sysInfo.getProperty("version")) >= 6 && + pref.getBoolPref(PREF_BDM_SCANWHENDONE)) { + dontAsk = true; + } + } catch (ex) { } +#endif if (!dontAsk) { var strings = document.getElementById("downloadStrings"); @@ -478,10 +477,11 @@ var gDownloadObserver = { removeFromView(dl); break; case "browser-lastwindow-close-granted": - if (AppConstants.platform != "macosx" && - gDownloadManager.activeDownloadCount == 0) { +#ifndef XP_MACOSX + if (gDownloadManager.activeDownloadCount == 0) { setTimeout(gCloseDownloadManager, 0); } +#endif break; } } |