Bug 708595 - Clarify download history related preferences in the Privacy pane. r=jwein

--HG--
extra : rebase_source : 16f3e7973494a01bc0be1287ceaee636416258e2
This commit is contained in:
Javi Rueda 2012-02-13 21:54:41 +01:00
Родитель 65e6bea80b
Коммит 391a3d76ce
5 изменённых файлов: 4 добавлений и 61 удалений

Просмотреть файл

@ -80,7 +80,6 @@ var gPrivacyPane = {
*/
prefsForDefault: [
"places.history.enabled",
"browser.download.manager.retention",
"browser.formfill.enable",
"network.cookie.cookieBehavior",
"network.cookie.lifetimePolicy",
@ -96,7 +95,6 @@ var gPrivacyPane = {
*/
dependentControls: [
"rememberHistory",
"rememberDownloads",
"rememberForms",
"keepUntil",
"keepCookiesUntil",
@ -177,10 +175,6 @@ var gPrivacyPane = {
if (!rememberHistoryCheckbox.checked)
rememberHistoryCheckbox.checked = true;
// select the remember downloads option if needed
if (!document.getElementById("rememberDownloads").checked)
document.getElementById("browser.download.manager.retention").value = 2;
// select the remember forms history option
document.getElementById("browser.formfill.enable").value = true;
@ -223,8 +217,6 @@ var gPrivacyPane = {
// adjust the checked state of the remember history checkboxes
document.getElementById("rememberHistory").checked = disabled ? false :
document.getElementById("places.history.enabled").value;
document.getElementById("rememberDownloads").checked = disabled ? false :
this.readDownloadRetention();
document.getElementById("rememberForms").checked = disabled ? false :
document.getElementById("browser.formfill.enable").value;
@ -331,36 +323,8 @@ var gPrivacyPane = {
* browser.formfill.enable
* - true if entries in forms and the search bar should be saved, false
* otherwise
* browser.download.manager.retention
* - determines when downloads are automatically removed from the download
* manager:
*
* 0 means remove downloads when they finish downloading
* 1 means downloads will be removed when the browser quits
* 2 means never remove downloads
*/
/**
* Converts the value of the browser.download.manager.retention preference
* into a Boolean value. "remove on close" and "don't remember" both map
* to an unchecked checkbox, while "remember" maps to a checked checkbox.
*/
readDownloadRetention: function ()
{
var pref = document.getElementById("browser.download.manager.retention");
return (pref.value == 2);
},
/**
* Returns the appropriate value of the browser.download.manager.retention
* preference for the current UI.
*/
writeDownloadRetention: function ()
{
var checkbox = document.getElementById("rememberDownloads");
return checkbox.checked ? 2 : 0;
},
// COOKIES
/*

Просмотреть файл

@ -87,9 +87,6 @@
<preference id="browser.formfill.enable"
name="browser.formfill.enable"
type="bool"/>
<preference id="browser.download.manager.retention"
name="browser.download.manager.retention"
type="int"/>
<!-- Cookies -->
<preference id="network.cookie.cookieBehavior" name="network.cookie.cookieBehavior" type="int"/>
@ -194,15 +191,9 @@
<vbox class="indent">
<vbox class="indent">
<checkbox id="rememberHistory"
label="&rememberHistory.label;"
accesskey="&rememberHistory.accesskey;"
label="&rememberHistory2.label;"
accesskey="&rememberHistory2.accesskey;"
preference="places.history.enabled"/>
<checkbox id="rememberDownloads"
label="&rememberDownload.label;"
accesskey="&rememberDownload.accesskey;"
preference="browser.download.manager.retention"
onsyncfrompreference="return gPrivacyPane.readDownloadRetention();"
onsynctopreference="return gPrivacyPane.writeDownloadRetention();"/>
<checkbox id="rememberForms"
label="&rememberSearchForm.label;"
accesskey="&rememberSearchForm.accesskey;"

Просмотреть файл

@ -49,8 +49,6 @@ function test() {
run_test_subset([
test_custom_retention("rememberHistory", "remember"),
test_custom_retention("rememberHistory", "custom"),
test_custom_retention("rememberDownloads", "remember"),
test_custom_retention("rememberDownloads", "custom"),
test_custom_retention("rememberForms", "remember"),
test_custom_retention("rememberForms", "custom"),
test_historymode_retention("remember", "remember"),

Просмотреть файл

@ -92,7 +92,6 @@ function test_dependent_elements(win) {
ok(pbautostart, "the private browsing auto-start checkbox should exist");
let controls = [
win.document.getElementById("rememberHistory"),
win.document.getElementById("rememberDownloads"),
win.document.getElementById("rememberForms"),
win.document.getElementById("keepUntil"),
win.document.getElementById("keepCookiesUntil"),
@ -116,8 +115,6 @@ function test_dependent_elements(win) {
ok(alwaysclear, "the clear data on close checkbox should exist");
let rememberhistory = win.document.getElementById("rememberHistory");
ok(rememberhistory, "the remember history checkbox should exist");
let rememberdownloads = win.document.getElementById("rememberDownloads");
ok(rememberdownloads, "the remember downloads checkbox should exist");
let rememberforms = win.document.getElementById("rememberForms");
ok(rememberforms, "the remember forms checkbox should exist");
let alwaysclearsettings = win.document.getElementById("clearDataSettings");
@ -135,8 +132,6 @@ function test_dependent_elements(win) {
"the clear data on close checkbox value should be as expected");
ok(!rememberhistory.checked,
"the remember history checkbox value should be as expected");
ok(!rememberdownloads.checked,
"the remember downloads checkbox value should be as expected");
ok(!rememberforms.checked,
"the remember forms checkbox value should be as expected");
}
@ -302,7 +297,6 @@ function test_dependent_prefs(win) {
ok(historymode, "history mode menulist should exist");
let controls = [
win.document.getElementById("rememberHistory"),
win.document.getElementById("rememberDownloads"),
win.document.getElementById("rememberForms"),
win.document.getElementById("acceptCookies"),
win.document.getElementById("acceptThirdParty"),

Просмотреть файл

@ -15,7 +15,6 @@
<!ENTITY locbar.bookmarks.label "Bookmarks">
<!ENTITY locbar.nothing.label "Nothing">
<!ENTITY acceptCookies.label "Accept cookies from sites">
<!ENTITY acceptCookies.accesskey "A">
@ -64,11 +63,8 @@
<!ENTITY privateBrowsingPermanent2.label "Always use private browsing mode">
<!ENTITY privateBrowsingPermanent2.accesskey "p">
<!ENTITY rememberHistory.label "Remember my browsing history">
<!ENTITY rememberHistory.accesskey "b">
<!ENTITY rememberDownload.label "Remember download history">
<!ENTITY rememberDownload.accesskey "d">
<!ENTITY rememberHistory2.label "Remember my browsing and download history">
<!ENTITY rememberHistory2.accesskey "b">
<!ENTITY rememberSearchForm.label "Remember search and form history">
<!ENTITY rememberSearchForm.accesskey "f">