Re-land pref fix for Clear Recent History. b=453440 r=gavin a=blocking-firefox3.1

This commit is contained in:
Johnathan Nightingale 2008-11-12 08:58:24 -05:00
parent 4cb728c278
commit 4a12c6d2be

View File

@ -102,10 +102,17 @@
sanitize: function ()
{
// Update pref values before handing off to the sanitizer (bug 453440)
this.updatePrefs();
var s = new Sanitizer();
s.ignoreTimespan = false;
s.prefDomain = "privacy.cpd.";
s.sanitize();
try {
s.sanitize();
} catch (er) {
Components.utils.reportError("Exception during sanitize: " + er);
}
return true;
},
onReadGeneric: function ()
@ -155,6 +162,18 @@
if (history.checked)
downloads.checked = true;
},
updatePrefs : function ()
{
var tsPref = document.getElementById("privacy.sanitize.timeSpan");
Sanitizer.prefs.setIntPref("timeSpan", tsPref.value);
var sanitizePreferences = document.getElementById("sanitizePreferences");
var prefs = sanitizePreferences.rootBranch;
for (var i = 0; i < sanitizePreferences.childNodes.length; ++i) {
var p = sanitizePreferences.childNodes[i];
prefs.setBoolPref(p.name, p.value);
}
}
};
]]>
</script>