mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
Issue #65 - Remove AppConstants from toolkit/mozapps/downloads
This commit is contained in:
parent
905663865e
commit
f1210b0d9a
5 changed files with 141 additions and 138 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue