mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Bug 402452 - Some download manager preferences should be assumed, not required. r=Mardak, r=mfinkle, a=schrep
This commit is contained in:
parent
979604b65e
commit
2683b199f5
@ -94,7 +94,6 @@
|
||||
#define PREF_BDM_SHOWALERTINTERVAL "browser.download.manager.showAlertInterval"
|
||||
#define PREF_BDM_RETENTION "browser.download.manager.retention"
|
||||
#define PREF_BDM_QUITBEHAVIOR "browser.download.manager.quitBehavior"
|
||||
#define PREF_BDM_CLOSEWHENDONE "browser.download.manager.closeWhenDone"
|
||||
#define PREF_BDM_ADDTORECENTDOCS "browser.download.manager.addToRecentDocs"
|
||||
#define PREF_BDM_SCANWHENDONE "browser.download.manager.scanWhenDone"
|
||||
#define PREF_BH_DELETETEMPFILEONEXIT "browser.helperApps.deleteTempFileOnExit"
|
||||
|
@ -108,7 +108,11 @@ nsDownloadManagerUI.prototype = {
|
||||
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
var flashCount = prefs.getIntPref(PREF_FLASH_COUNT);
|
||||
// This preference may not be set, so defaulting to two.
|
||||
let flashCount = 2;
|
||||
try {
|
||||
flashCount = prefs.getIntPref(PREF_FLASH_COUNT);
|
||||
} catch (e) { }
|
||||
|
||||
var win = this.recentWindow.QueryInterface(Ci.nsIDOMChromeWindow);
|
||||
win.getAttentionWithCycleCount(flashCount);
|
||||
|
@ -182,8 +182,13 @@ function autoRemoveAndClose(aDownload)
|
||||
// For the moment, just use the simple heuristic that if this window was
|
||||
// opened by the download process, rather than by the user, it should
|
||||
// auto-close if the pref is set that way. If the user opened it themselves,
|
||||
// it should not close until they explicitly close it.
|
||||
var autoClose = pref.getBoolPref(PREF_BDM_CLOSEWHENDONE);
|
||||
// it should not close until they explicitly close it. Additionally, the
|
||||
// preference to control the feature may not be set, so defaulting to
|
||||
// keeping the window open.
|
||||
let autoClose = false;
|
||||
try {
|
||||
autoClose = pref.getBoolPref(PREF_BDM_CLOSEWHENDONE);
|
||||
} catch (e) { }
|
||||
var autoOpened =
|
||||
!window.opener || window.opener.location.href == window.location.href;
|
||||
if (autoClose && autoOpened && !gUserInteracted) {
|
||||
|
@ -54,6 +54,7 @@
|
||||
* nsUnknownContentTypeDialog component.
|
||||
*/
|
||||
|
||||
const PREF_BD_USEDOWNLOADDIR = "browser.download.useDownloadDir";
|
||||
|
||||
/* ctor
|
||||
*/
|
||||
@ -138,9 +139,14 @@ nsUnknownContentTypeDialog.prototype = {
|
||||
this.mLauncher = aLauncher;
|
||||
|
||||
// Check to see if the user wishes to auto save to the default download
|
||||
// folder without prompting.
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
var autodownload = prefs.getBoolPref("browser.download.useDownloadDir");
|
||||
// folder without prompting. This preferences may not be set, so default
|
||||
// to not prompting.
|
||||
let prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
let autodownload = true;
|
||||
try {
|
||||
autodownload = prefs.getBoolPref(PREF_BD_USEDOWNLOADDIR);
|
||||
} catch (e) { }
|
||||
|
||||
if (autodownload) {
|
||||
// Retrieve the user's default download directory
|
||||
|
Loading…
Reference in New Issue
Block a user