summaryrefslogtreecommitdiffstats
path: root/comm/suite/components/pref/content/pref-privatedata.js
blob: ba7305bc41d6150f319249a1f502480ca0b26d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */

function Startup() {
  let pref = document.getElementById("privacy.sanitize.sanitizeOnShutdown");
  updateClearOnShutdownBox(pref.valueFromPreferences);
}

/**
 * Disable/enable clear on shutdown items in dialog depending on general pref
 *  to clear on shutdown.
 */
function updateClearOnShutdownBox(aDisable) {
  let clearOnShutdownBox = document.getElementById("clearOnShutdownBox");
  for (let childNode of clearOnShutdownBox.childNodes) {
    childNode.disabled = !aDisable;
  }
}

/**
 * Displays a dialog from which individual parts of private data may be
 * cleared.
 */
function clearPrivateDataNow() {
  Cc["@mozilla.org/suite/suiteglue;1"]
    .getService(Ci.nsISuiteGlue)
    .sanitize(window);
}