CINXE.COM
Index: browser/components/preferences/privacy.js =================================================================== RCS file: /cvsroot/mozilla/browser/components/preferences/privacy.js,v retrieving revision 1.25 diff -U8 -p -d -r1.25 privacy.js --- browser/components/preferences/privacy.js 25 Feb 2008 08:50:16 -0000 1.25 +++ browser/components/preferences/privacy.js 6 Mar 2008 21:55:16 -0000 @@ -156,53 +156,64 @@ var gPrivacyPane = { // COOKIES /* * Preferences: * * network.cookie.cookieBehavior * - determines how the browser should handle cookies: * 0 means enable all cookies - * 1 means allow cookies from the "originating" server only; see + * 1 means reject third party cookies; see * netwerk/cookie/src/nsCookieService.cpp for a hairier definition * 2 means disable all cookies * network.cookie.lifetimePolicy * - determines how long cookies are stored: * 0 means keep cookies until they expire * 1 means ask how long to keep each cookie * 2 means keep cookies until the browser is closed */ /** * Reads the network.cookie.cookieBehavior preference value and - * enables/disables the "Keep until:" UI accordingly, returning true + * enables/disables the rest of the cookie UI accordingly, returning true * if cookies are enabled. */ readAcceptCookies: function () { var pref = document.getElementById("network.cookie.cookieBehavior"); + var acceptThirdParty = document.getElementById("acceptThirdParty"); var keepUntil = document.getElementById("keepUntil"); var menu = document.getElementById("keepCookiesUntil"); - // anything other than "disable all cookies" maps to "accept cookies" + // enable the rest of the UI for anything other than "disable all cookies" var acceptCookies = (pref.value != 2); - keepUntil.disabled = menu.disabled = !acceptCookies; + keepUntil.disabled = menu.disabled = acceptThirdParty.disabled = !acceptCookies; return acceptCookies; }, + _acceptThirdPartyWasChecked: true, + readAcceptThirdPartyCookies: function () + { + var pref = document.getElementById("network.cookie.cookieBehavior"); + return pref.value == 2 ? this._acceptThirdPartyWasChecked + : pref.value == 0; + }, + /** * Enables/disables the "keep until" label and menulist in response to the * "accept cookies" checkbox being checked or unchecked. */ writeAcceptCookies: function () { - var checkbox = document.getElementById("acceptCookies"); - return checkbox.checked ? 0 : 2; + var accept = document.getElementById("acceptCookies"); + var acceptThirdParty = document.getElementById("acceptThirdParty"); + this._acceptThirdPartyWasChecked = acceptThirdParty.checked; + return accept.checked ? (acceptThirdParty.checked ? 0 : 1) : 2; }, /** * Displays fine-grained, per-site preferences for cookies. */ showCookieExceptions: function () { var bundlePreferences = document.getElementById("bundlePreferences"); Index: browser/components/preferences/privacy.xul =================================================================== RCS file: /cvsroot/mozilla/browser/components/preferences/privacy.xul,v retrieving revision 1.25 diff -U8 -p -d -r1.25 privacy.xul --- browser/components/preferences/privacy.xul 13 Jan 2008 08:30:55 -0000 1.25 +++ browser/components/preferences/privacy.xul 6 Mar 2008 21:55:16 -0000 @@ -138,16 +138,22 @@ preference="network.cookie.cookieBehavior" accesskey="&acceptCookies.accesskey;" onsyncfrompreference="return gPrivacyPane.readAcceptCookies();" onsynctopreference="return gPrivacyPane.writeAcceptCookies();"/> <button id="cookieExceptions" oncommand="gPrivacyPane.showCookieExceptions();" label="&cookieExceptions.label;" accesskey="&cookieExceptions.accesskey;" preference="pref.privacy.disable_button.cookie_exceptions"/> </hbox> + <checkbox id="acceptThirdParty" label="&acceptThirdParty.label;" class="indent" + preference="network.cookie.cookieBehavior" + accesskey="&acceptThirdParty.accesskey;" + onsyncfrompreference="return gPrivacyPane.readAcceptThirdPartyCookies();" + onsynctopreference="return gPrivacyPane.writeAcceptCookies();"/> + <hbox id="keepRow"> <hbox id="keepBox" align="center" class="indent"> <label id="keepUntil" control="keepCookiesUntil" accesskey="&keepUntil.accesskey;">&keepUntil.label;</label> <menulist id="keepCookiesUntil" preference="network.cookie.lifetimePolicy"> <menupopup> Index: browser/locales/en-US/chrome/browser/preferences/privacy.dtd =================================================================== RCS file: /cvsroot/mozilla/browser/locales/en-US/chrome/browser/preferences/privacy.dtd,v retrieving revision 1.18 diff -U8 -p -d -r1.18 privacy.dtd --- browser/locales/en-US/chrome/browser/preferences/privacy.dtd 5 Dec 2007 08:30:07 -0000 1.18 +++ browser/locales/en-US/chrome/browser/preferences/privacy.dtd 6 Mar 2008 21:55:16 -0000 @@ -17,16 +17,19 @@ <!ENTITY rememberDownloads.accesskey "d"> <!ENTITY cookies.label "Cookies"> <!ENTITY acceptCookies.label "Accept cookies from sites"> <!ENTITY acceptCookies.accesskey "c"> +<!ENTITY acceptThirdParty.label "Accept third-party cookies"> +<!ENTITY acceptThirdParty.accesskey "g"> + <!ENTITY keepUntil.label "Keep until:"> <!ENTITY keepUntil.accesskey "K"> <!ENTITY expire.label "they expire"> <!ENTITY close.label "I close &brandShortName;"> <!ENTITY askEachTime.label "ask me every time"> <!ENTITY cookieExceptions.label "Exceptions…">