Bug 723328 - Move the privacy preferences to in-content UI. r=bmcbride
authorJon Rietveld <jon.rietveld@gmail.com>
Tue, 08 May 2012 19:16:26 -0700
changeset 93576 d849b7493ea2348c99fc7582e3d6950ca6125fdf
parent 93575 c14a9f3448da84e456a71cd7920ac737d8c9527a
child 93577 68e7c139e580502a3631385a5645bcdffd5dedb2
push id9210
push userjwein@mozilla.com
push dateWed, 09 May 2012 05:35:43 +0000
treeherdermozilla-inbound@8b195889f55c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbmcbride
bugs723328
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 723328 - Move the privacy preferences to in-content UI. r=bmcbride
browser/components/preferences/in-content/jar.mn
browser/components/preferences/in-content/preferences.js
browser/components/preferences/in-content/preferences.xul
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
--- a/browser/components/preferences/in-content/jar.mn
+++ b/browser/components/preferences/in-content/jar.mn
@@ -1,8 +1,10 @@
 browser.jar:
 *  content/browser/preferences/in-content/preferences.js
    content/browser/preferences/in-content/landing.xul
 *  content/browser/preferences/in-content/preferences.xul
 *  content/browser/preferences/in-content/main.xul
    content/browser/preferences/in-content/main.js
 *  content/browser/preferences/in-content/tabs.xul
 *  content/browser/preferences/in-content/tabs.js
+   content/browser/preferences/in-content/privacy.xul
+   content/browser/preferences/in-content/privacy.js
--- a/browser/components/preferences/in-content/preferences.js
+++ b/browser/components/preferences/in-content/preferences.js
@@ -16,16 +16,17 @@ function init_all() {
   document.documentElement.instantApply = true;
   window.history.replaceState("landing", document.title);
   window.addEventListener("popstate", onStatePopped, true);
   updateCommands();
   gMainPane.init();
 #ifdef XP_WIN
   gTabsPane.init();
 #endif
+  gPrivacyPane.init();
   var initFinished = document.createEvent("Event");
   initFinished.initEvent("Initialized", true, true);
   document.dispatchEvent(initFinished);
 }
 
 function gotoPref(page) {
   search(page, "data-category");
   window.history.pushState(page, document.title);
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -87,12 +87,13 @@
                    disabled="true"/>
   </hbox>
   
   <hbox class="main-content" flex="1">
     <prefpane flex="1" id="mainPrefPane">
 #include landing.xul
 #include main.xul
 #include tabs.xul
+#include privacy.xul
     </prefpane>
   </hbox>
   
 </page>
new file mode 100644
--- /dev/null
+++ b/browser/components/preferences/in-content/privacy.js
@@ -0,0 +1,435 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+var gPrivacyPane = {
+
+  /**
+   * Whether the use has selected the auto-start private browsing mode in the UI.
+   */
+  _autoStartPrivateBrowsing: false,
+
+  /**
+   * Sets up the UI for the number of days of history to keep, and updates the
+   * label of the "Clear Now..." button.
+   */
+  init: function ()
+  {
+    this._updateSanitizeSettingsButton();
+    this.initializeHistoryMode();
+    this.updateHistoryModePane();
+    this.updatePrivacyMicroControls();
+    this.initAutoStartPrivateBrowsingObserver();
+
+    window.addEventListener("unload", this.removeASPBObserver.bind(this), false);
+  },
+
+  // HISTORY MODE
+
+  /**
+   * The list of preferences which affect the initial history mode settings.
+   * If the auto start private browsing mode pref is active, the initial
+   * history mode would be set to "Don't remember anything".
+   * If all of these preferences have their default values, and the auto-start
+   * private browsing mode is not active, the initial history mode would be
+   * set to "Remember everything".
+   * Otherwise, the initial history mode would be set to "Custom".
+   *
+   * Extensions adding their own preferences can append their IDs to this array if needed.
+   */
+  prefsForDefault: [
+    "places.history.enabled",
+    "browser.formfill.enable",
+    "network.cookie.cookieBehavior",
+    "network.cookie.lifetimePolicy",
+    "privacy.sanitize.sanitizeOnShutdown"
+  ],
+
+  /**
+   * The list of control IDs which are dependent on the auto-start private
+   * browsing setting, such that in "Custom" mode they would be disabled if
+   * the auto-start private browsing checkbox is checked, and enabled otherwise.
+   *
+   * Extensions adding their own controls can append their IDs to this array if needed.
+   */
+  dependentControls: [
+    "rememberHistory",
+    "rememberForms",
+    "keepUntil",
+    "keepCookiesUntil",
+    "alwaysClear",
+    "clearDataSettings"
+  ],
+
+  /**
+   * Check whether all the preferences values are set to their default values
+   *
+   * @param aPrefs an array of pref names to check for
+   * @returns boolean true if all of the prefs are set to their default values,
+   *                  false otherwise
+   */
+  _checkDefaultValues: function(aPrefs) {
+    for (let i = 0; i < aPrefs.length; ++i) {
+      let pref = document.getElementById(aPrefs[i]);
+      if (pref.value != pref.defaultValue)
+        return false;
+    }
+    return true;
+  },
+
+  /**
+   * Initialize the history mode menulist based on the privacy preferences
+   */
+  initializeHistoryMode: function PPP_initializeHistoryMode()
+  {
+    let mode;
+    let getVal = function (aPref)
+      document.getElementById(aPref).value;
+
+    if (this._checkDefaultValues(this.prefsForDefault)) {
+      if (getVal("browser.privatebrowsing.autostart"))
+        mode = "dontremember";
+      else
+        mode = "remember";
+    }
+    else
+      mode = "custom";
+
+    document.getElementById("historyMode").value = mode;
+  },
+
+  /**
+   * Update the selected pane based on the history mode menulist
+   */
+  updateHistoryModePane: function PPP_updateHistoryModePane()
+  {
+    let selectedIndex = -1;
+    switch (document.getElementById("historyMode").value) {
+    case "remember":
+      selectedIndex = 0;
+      break;
+    case "dontremember":
+      selectedIndex = 1;
+      break;
+    case "custom":
+      selectedIndex = 2;
+      break;
+    }
+    document.getElementById("historyPane").selectedIndex = selectedIndex;
+  },
+
+  /**
+   * Update the private browsing auto-start pref and the history mode
+   * micro-management prefs based on the history mode menulist
+   */
+  updateHistoryModePrefs: function PPP_updateHistoryModePrefs()
+  {
+    let pref = document.getElementById("browser.privatebrowsing.autostart");
+    switch (document.getElementById("historyMode").value) {
+    case "remember":
+      pref.value = false;
+
+      // select the remember history option if needed
+      let rememberHistoryCheckbox = document.getElementById("rememberHistory");
+      if (!rememberHistoryCheckbox.checked)
+        rememberHistoryCheckbox.checked = true;
+
+      // select the remember forms history option
+      document.getElementById("browser.formfill.enable").value = true;
+
+      // select the accept cookies option
+      document.getElementById("network.cookie.cookieBehavior").value = 0;
+      // select the cookie lifetime policy option
+      document.getElementById("network.cookie.lifetimePolicy").value = 0;
+
+      // select the clear on close option
+      document.getElementById("privacy.sanitize.sanitizeOnShutdown").value = false;
+      break;
+    case "dontremember":
+      pref.value = true;
+      break;
+    }
+  },
+
+  /**
+   * Update the privacy micro-management controls based on the
+   * value of the private browsing auto-start checkbox.
+   */
+  updatePrivacyMicroControls: function PPP_updatePrivacyMicroControls()
+  {
+    if (document.getElementById("historyMode").value == "custom") {
+      let disabled = this._autoStartPrivateBrowsing =
+        document.getElementById("privateBrowsingAutoStart").checked;
+      this.dependentControls
+          .forEach(function (aElement)
+                   document.getElementById(aElement).disabled = disabled);
+
+      // adjust the cookie controls status
+      this.readAcceptCookies();
+      document.getElementById("keepCookiesUntil").value = disabled ? 2 :
+        document.getElementById("network.cookie.lifetimePolicy").value;
+
+      // adjust the checked state of the sanitizeOnShutdown checkbox
+      document.getElementById("alwaysClear").checked = disabled ? false :
+        document.getElementById("privacy.sanitize.sanitizeOnShutdown").value;
+
+      // adjust the checked state of the remember history checkboxes
+      document.getElementById("rememberHistory").checked = disabled ? false :
+        document.getElementById("places.history.enabled").value;
+      document.getElementById("rememberForms").checked = disabled ? false :
+        document.getElementById("browser.formfill.enable").value;
+
+      if (!disabled) {
+        // adjust the Settings button for sanitizeOnShutdown
+        this._updateSanitizeSettingsButton();
+      }
+    }
+  },
+
+  // PRIVATE BROWSING
+
+  /**
+   * Install the observer for the auto-start private browsing mode pref.
+   */
+  initAutoStartPrivateBrowsingObserver: function PPP_initAutoStartPrivateBrowsingObserver()
+  {
+    let prefService = document.getElementById("privacyPreferences")
+                              .service
+                              .QueryInterface(Components.interfaces.nsIPrefBranch);
+    prefService.addObserver("browser.privatebrowsing.autostart",
+                            this.autoStartPrivateBrowsingObserver,
+                            false);
+  },
+
+  /**
+   * Install the observer for the auto-start private browsing mode pref.
+   */
+  removeASPBObserver: function PPP_removeASPBObserver()
+  {
+    let prefService = document.getElementById("privacyPreferences")
+                              .service
+                              .QueryInterface(Components.interfaces.nsIPrefBranch);
+    prefService.removeObserver("browser.privatebrowsing.autostart",
+                               this.autoStartPrivateBrowsingObserver);
+  },
+
+  autoStartPrivateBrowsingObserver:
+  {
+    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
+
+    observe: function PPP_observe(aSubject, aTopic, aData)
+    {
+      let privateBrowsingService = Components.classes["@mozilla.org/privatebrowsing;1"].
+        getService(Components.interfaces.nsIPrivateBrowsingService);
+
+      // Toggle the private browsing mode without switching the session
+      let prefValue = document.getElementById("browser.privatebrowsing.autostart").value;
+      let keepCurrentSession = document.getElementById("browser.privatebrowsing.keep_current_session");
+      keepCurrentSession.value = true;
+      // If activating from within the private browsing mode, reset the
+      // private session
+      if (prefValue && privateBrowsingService.privateBrowsingEnabled)
+        privateBrowsingService.privateBrowsingEnabled = false;
+      privateBrowsingService.privateBrowsingEnabled = prefValue;
+      keepCurrentSession.reset();
+    }
+  },
+
+  // HISTORY
+
+  /**
+   * Read the location bar enabled and suggestion prefs
+   * @return Int value for suggestion menulist
+   */
+  readSuggestionPref: function PPP_readSuggestionPref()
+  {
+    let getVal = function(aPref)
+      document.getElementById("browser.urlbar." + aPref).value;
+
+    // Suggest nothing if autocomplete is not enabled
+    if (!getVal("autocomplete.enabled"))
+      return -1;
+
+    // Bottom 2 bits of default.behavior specify history/bookmark
+    return getVal("default.behavior") & 3;
+  },
+
+  /**
+   * Write the location bar enabled and suggestion prefs when necessary
+   * @return Bool value for enabled pref
+   */
+  writeSuggestionPref: function PPP_writeSuggestionPref()
+  {
+    let menuVal = document.getElementById("locationBarSuggestion").value;
+    let enabled = menuVal != -1;
+
+    // Only update default.behavior if we're giving suggestions
+    if (enabled) {
+      // Put the selected menu item's value directly into the bottom 2 bits
+      let behavior = document.getElementById("browser.urlbar.default.behavior");
+      behavior.value = behavior.value >> 2 << 2 | menuVal;
+    }
+
+    // Always update the enabled pref
+    return enabled;
+  },
+
+  /*
+   * Preferences:
+   *
+   * places.history.enabled
+   * - whether history is enabled or not
+   * browser.formfill.enable
+   * - true if entries in forms and the search bar should be saved, false
+   *   otherwise
+   */
+
+  // COOKIES
+
+  /*
+   * Preferences:
+   *
+   * network.cookie.cookieBehavior
+   * - determines how the browser should handle cookies:
+   *     0   means enable all cookies
+   *     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 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");
+
+    // enable the rest of the UI for anything other than "disable all cookies"
+    var acceptCookies = (pref.value != 2);
+
+    acceptThirdParty.disabled = !acceptCookies;
+    keepUntil.disabled = menu.disabled = this._autoStartPrivateBrowsing || !acceptCookies;
+
+    return acceptCookies;
+  },
+
+  readAcceptThirdPartyCookies: function ()
+  {
+    var pref = document.getElementById("network.cookie.cookieBehavior");
+    return 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 accept = document.getElementById("acceptCookies");
+    var acceptThirdParty = document.getElementById("acceptThirdParty");
+
+    // if we're enabling cookies, automatically check 'accept third party'
+    if (accept.checked)
+      acceptThirdParty.checked = true;
+
+    return accept.checked ? (acceptThirdParty.checked ? 0 : 1) : 2;
+  },
+
+  writeAcceptThirdPartyCookies: function ()
+  {
+    var accept = document.getElementById("acceptCookies");
+    var acceptThirdParty = document.getElementById("acceptThirdParty");
+    return accept.checked ? (acceptThirdParty.checked ? 0 : 1) : 2;
+  },
+
+  /**
+   * Displays fine-grained, per-site preferences for cookies.
+   */
+  showCookieExceptions: function ()
+  {
+    var bundlePreferences = document.getElementById("bundlePreferences");
+    var params = { blockVisible   : true,
+                   sessionVisible : true,
+                   allowVisible   : true,
+                   prefilledHost  : "",
+                   permissionType : "cookie",
+                   windowTitle    : bundlePreferences.getString("cookiepermissionstitle"),
+                   introText      : bundlePreferences.getString("cookiepermissionstext") };
+    openDialog("chrome://browser/content/preferences/permissions.xul",
+               "Browser:Permissions",
+               "model=yes", params);
+  },
+
+  /**
+   * Displays all the user's cookies in a dialog.
+   */
+  showCookies: function (aCategory)
+  {
+    openDialog("chrome://browser/content/preferences/cookies.xul",
+               "Browser:Cookies",
+               "model=yes", null);
+  },
+
+  // CLEAR PRIVATE DATA
+
+  /*
+   * Preferences:
+   *
+   * privacy.sanitize.sanitizeOnShutdown
+   * - true if the user's private data is cleared on startup according to the
+   *   Clear Private Data settings, false otherwise
+   */
+
+  /**
+   * Displays the Clear Private Data settings dialog.
+   */
+  showClearPrivateDataSettings: function ()
+  {
+    openDialog("chrome://browser/content/preferences/sanitize.xul",
+               "model=yes", null);
+  },
+
+
+  /**
+   * Displays a dialog from which individual parts of private data may be
+   * cleared.
+   */
+  clearPrivateDataNow: function (aClearEverything)
+  {
+    var ts = document.getElementById("privacy.sanitize.timeSpan");
+    var timeSpanOrig = ts.value;
+    if (aClearEverything)
+      ts.value = 0;
+
+    const Cc = Components.classes, Ci = Components.interfaces;
+    var glue = Cc["@mozilla.org/browser/browserglue;1"]
+                 .getService(Ci.nsIBrowserGlue);
+    glue.sanitize(window);
+
+    // reset the timeSpan pref
+    if (aClearEverything)
+      ts.value = timeSpanOrig;
+  },
+
+  /**
+   * Enables or disables the "Settings..." button depending
+   * on the privacy.sanitize.sanitizeOnShutdown preference value
+   */
+  _updateSanitizeSettingsButton: function () {
+    var settingsButton = document.getElementById("clearDataSettings");
+    var sanitizeOnShutdownPref = document.getElementById("privacy.sanitize.sanitizeOnShutdown");
+
+    settingsButton.disabled = !sanitizeOnShutdownPref.value;
+   }
+
+};
new file mode 100644
--- /dev/null
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -0,0 +1,223 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+
+<script type="application/javascript"
+        src="chrome://browser/content/preferences/in-content/privacy.js"/>
+
+<preferences id="privacyPreferences">
+
+  <!-- Tracking -->
+  <preference id="privacy.donottrackheader.enabled"
+              name="privacy.donottrackheader.enabled"
+              type="bool"/>
+
+  <!-- XXX button prefs -->
+  <preference id="pref.privacy.disable_button.cookie_exceptions"
+              name="pref.privacy.disable_button.cookie_exceptions"
+              type="bool"/>
+  <preference id="pref.privacy.disable_button.view_cookies"
+              name="pref.privacy.disable_button.view_cookies"
+              type="bool"/>
+
+  <!-- Location Bar -->
+  <preference id="browser.urlbar.autocomplete.enabled"
+              name="browser.urlbar.autocomplete.enabled"
+              type="bool"/>
+  <preference id="browser.urlbar.default.behavior"
+              name="browser.urlbar.default.behavior"
+              type="int"
+              onchange="document.getElementById('browser.urlbar.autocomplete.enabled').updateElements();"/>
+
+  <!-- History -->
+  <preference id="places.history.enabled"
+              name="places.history.enabled"
+              type="bool"/>
+  <preference id="browser.formfill.enable"
+              name="browser.formfill.enable"
+              type="bool"/>
+  <!-- Cookies -->
+  <preference id="network.cookie.cookieBehavior"
+              name="network.cookie.cookieBehavior"
+              type="int"/>
+  <preference id="network.cookie.lifetimePolicy"
+              name="network.cookie.lifetimePolicy"
+              type="int"/>
+  <preference id="network.cookie.blockFutureCookies"
+              name="network.cookie.blockFutureCookies"
+              type="bool"/>
+  <!-- Clear Private Data -->
+  <preference id="privacy.sanitize.sanitizeOnShutdown"
+              name="privacy.sanitize.sanitizeOnShutdown"
+              onchange="gPrivacyPane._updateSanitizeSettingsButton();"
+              type="bool"/>
+  <preference id="privacy.sanitize.timeSpan"
+              name="privacy.sanitize.timeSpan"
+              type="int"/>
+  <!-- Private Browsing -->
+  <preference id="browser.privatebrowsing.autostart"
+              name="browser.privatebrowsing.autostart"
+              onchange="gPrivacyPane.updatePrivacyMicroControls();"
+              type="bool"/>
+  <preference id="browser.privatebrowsing.keep_current_session"
+              name="browser.privatebrowsing.keep_current_session"
+              instantApply="true"
+              type="bool"/>
+
+</preferences>
+
+<hbox class="heading" data-category="panePrivacy" hidden="true">
+  <image class="preference-icon" type="privacy"/>
+  <html:h1>&panePrivacy.title;</html:h1>
+</hbox>
+
+<!-- Tracking -->
+<groupbox id="trackingGroup" data-category="panePrivacy" hidden="true">
+  <caption label="&tracking.label;"/>
+
+  <checkbox id="privacyDoNotTrackPrefs"
+            label="&doNotTrack.label;"
+            accesskey="&doNotTrack.accesskey;"
+            preference="privacy.donottrackheader.enabled"/>
+</groupbox>
+
+<!-- History -->
+<groupbox id="historyGroup" data-category="panePrivacy" hidden="true">
+  <caption label="&history.label;"/>
+  <hbox align="center">
+    <label id="historyModeLabel"
+           control="historyMode"
+           accesskey="&historyHeader.pre.accesskey;">&historyHeader.pre.label;
+    </label>
+    <menulist id="historyMode"
+              oncommand="gPrivacyPane.updateHistoryModePane();
+                        gPrivacyPane.updateHistoryModePrefs();
+                        gPrivacyPane.updatePrivacyMicroControls();">
+      <menupopup>
+        <menuitem label="&historyHeader.remember.label;" value="remember"/>
+        <menuitem label="&historyHeader.dontremember.label;" value="dontremember"/>
+        <menuitem label="&historyHeader.custom.label;" value="custom"/>
+      </menupopup>
+    </menulist>
+    <label>&historyHeader.post.label;</label>
+  </hbox>
+  <deck id="historyPane">
+    <vbox align="center" id="historyRememberPane">
+      <hbox align="center" flex="1">
+        <spacer flex="1" class="indent"/>
+        <vbox flex="2">
+          <description>&rememberDescription.label;</description>
+          <separator/>
+          <description>&rememberActions.pre.label;<html:a
+          class="inline-link" href="#"
+          onclick="gPrivacyPane.clearPrivateDataNow(false); return false;"
+          >&rememberActions.clearHistory.label;</html:a>&rememberActions.middle.label;<html:a
+          class="inline-link" href="#"
+          onclick="gPrivacyPane.showCookies(); return false;"
+          >&rememberActions.removeCookies.label;</html:a>&rememberActions.post.label;</description>
+        </vbox>
+        <spacer flex="1" class="indent"/>
+      </hbox>
+    </vbox>
+    <vbox align="center" id="historyDontRememberPane">
+      <hbox align="center" flex="1">
+        <spacer flex="1" class="indent"/>
+        <vbox flex="2">
+          <description>&dontrememberDescription.label;</description>
+          <separator/>
+          <description>&dontrememberActions.pre.label;<html:a
+          class="inline-link" href="#"
+          onclick="gPrivacyPane.clearPrivateDataNow(true); return false;"
+          >&dontrememberActions.clearHistory.label;</html:a>&dontrememberActions.post.label;</description>
+        </vbox>
+        <spacer flex="1" class="indent"/>
+      </hbox>
+    </vbox>
+    <vbox id="historyCustomPane">
+      <separator class="thin"/>
+      <vbox class="indent">
+        <checkbox id="privateBrowsingAutoStart"
+                  label="&privateBrowsingPermanent2.label;"
+                  accesskey="&privateBrowsingPermanent2.accesskey;"
+                  preference="browser.privatebrowsing.autostart"/>
+
+        <vbox class="indent">
+          <checkbox id="rememberHistory"
+                    label="&rememberHistory2.label;"
+                    accesskey="&rememberHistory2.accesskey;"
+                    preference="places.history.enabled"/>
+          <checkbox id="rememberForms"
+                    label="&rememberSearchForm.label;"
+                    accesskey="&rememberSearchForm.accesskey;"
+                    preference="browser.formfill.enable"/>
+
+          <hbox id="cookiesBox">
+            <checkbox id="acceptCookies" label="&acceptCookies.label;" flex="1"
+                      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.writeAcceptThirdPartyCookies();"/>
+          <hbox id="keepRow" class="indent">
+            <label id="keepUntil"
+                   control="keepCookiesUntil"
+                   accesskey="&keepUntil.accesskey;">&keepUntil.label;</label>
+            <menulist id="keepCookiesUntil"
+                      preference="network.cookie.lifetimePolicy">
+              <menupopup>
+                <menuitem label="&expire.label;" value="0"/>
+                <menuitem label="&close.label;" value="2"/>
+                <menuitem label="&askEachTime.label;" value="1"/>
+              </menupopup>
+            </menulist>
+          </hbox>
+          <hbox flex="1">
+            <button id="showCookiesButton"
+                    label="&showCookies.label;" accesskey="&showCookies.accesskey;"
+                    oncommand="gPrivacyPane.showCookies();"
+                    preference="pref.privacy.disable_button.view_cookies"/>
+          </hbox>
+          <hbox id="clearDataBox" align="center">
+            <checkbox id="alwaysClear" flex="1"
+                      preference="privacy.sanitize.sanitizeOnShutdown"
+                      label="&clearOnClose.label;"
+                      accesskey="&clearOnClose.accesskey;"/>
+            <button id="clearDataSettings" label="&clearOnCloseSettings.label;"
+                    accesskey="&clearOnCloseSettings.accesskey;"
+                    oncommand="gPrivacyPane.showClearPrivateDataSettings();"/>
+          </hbox>
+        </vbox>
+      </vbox>
+    </vbox>
+  </deck>
+</groupbox>
+
+<!-- Location Bar -->
+<groupbox id="locationBarGroup" data-category="panePrivacy" hidden="true">
+  <caption label="&locationBar.label;"/>
+  <hbox align="center">
+    <label id="locationBarSuggestionLabel"
+           control="locationBarSuggestion"
+           accesskey="&locbar.pre.accessKey;">&locbar.pre.label;</label>
+    <menulist id="locationBarSuggestion"
+              preference="browser.urlbar.autocomplete.enabled"
+              onsyncfrompreference="return gPrivacyPane.readSuggestionPref();"
+              onsynctopreference="return gPrivacyPane.writeSuggestionPref();">
+      <menupopup>
+        <menuitem label="&locbar.both.label;" value="0"/>
+        <menuitem label="&locbar.history.label;" value="1"/>
+        <menuitem label="&locbar.bookmarks.label;" value="2"/>
+        <menuitem label="&locbar.nothing.label;" value="-1"/>
+      </menupopup>
+    </menulist>
+    <label>&locbar.post.label;</label>
+  </hbox>
+</groupbox>
\ No newline at end of file