39 var
prefs = Components.classes[
"@mozilla.org/preferences-service;1"]
40 .getService(Components.interfaces.nsIPrefBranch2);
41 var guid = prefs.getComplexValue(
"songbird.library.web",
42 Components.interfaces.nsISupportsString);
45 Components.classes[
"@songbirdnest.com/Songbird/library/Manager;1"]
46 .getService(Components.interfaces.sbILibraryManager);
48 this.webLibrary = libraryManager.getLibrary(guid);
49 this.webLibrary.addListener(
this,
51 Components.interfaces.sbIMediaList.LISTENER_FLAGS_ALL,
54 var prefpane = document.getElementById(
"SanitizeDialogPane");
56 var children = prefpane.childNodes;
57 for (var
i=0;
i<children.length;
i++) {
58 if (children[
i].tagName ==
"preferences" || children[
i].tagName ==
"xul:preferences") {
59 this.prefs = children[
i];
61 if (!this.checkBox && (children[
i].tagName ==
"checkbox" || children[
i].tagName ==
"xul:checkbox")) {
62 this.checkBox = document.createElement(
"checkbox");
63 this.checkBox.setAttribute(
"id",
"sanitize.mediaHistory");
64 this.checkBox.setAttribute(
"label",
SBString(
"sanitize.mediaHistory.label",
"Web Media History"));
65 this.checkBox.setAttribute(
"accesskey",
SBString(
"sanitize.mediaHistory.accesskey",
"W"));
66 this.checkBox.setAttribute(
"oncommand",
"gSongbirdSanitizeOverlay.onCommand();");
67 this.updateDisabled();
68 prefpane.insertBefore(this.checkBox, children[
i]);
73 if (this.checkBox && this.prefs) {
74 this.checkBox.setAttribute(
"checked", this.prefs.rootBranch.getBoolPref(
"privacy.item.mediaHistory"));
77 var helpButton = document.documentElement.getButton(
"help");
81 helpButton.collapsed =
true;
85 updateDisabled:
function() {
86 this.checkBox.setAttribute(
"disabled", this.webLibrary.length > 0 ?
"false" :
"true");
90 this.clearUpdateTimeout();
91 this.webLibrary.removeListener(
this);
95 onCheckboxChanged:
function() {
96 this.
prefs.rootBranch.setBoolPref(
"privacy.item.mediaHistory", this.checkBox.checked);
99 onWebHistoryChanged:
function() {
100 this.clearUpdateTimeout();
101 this.timeout =
setTimeout(
function(obj) { obj.updateTimeout(); }, 10,
this);
104 clearUpdateTimeout:
function() {
106 clearTimeout(this.timeout);
111 updateTimeout:
function() {
112 this.updateDisabled();
117 onItemAdded:
function(aMediaList, aMediaItem, aIndex) {
gSongbirdSanitizeOverlay.onWebHistoryChanged();
return true; },
118 onBeforeItemRemoved:
function(aMediaList, aMediaItem, aIndex) {
return true; },
119 onAfterItemRemoved:
function(aMediaList, aMediaItem, aIndex) {
gSongbirdSanitizeOverlay.onWebHistoryChanged();
return true; },
120 onItemUpdated:
function(aMediaList, aMediaItem, aProperties) {
return true; },
121 onItemMoved:
function(aMediaList, aFromIndex, aToIndex) {
return true; },
122 onBeforeListCleared:
function(aMediaList, aExcludeLists) {
return true; },
123 onListCleared:
function(aMediaList, aExcludeLists) {
gSongbirdSanitizeOverlay.onWebHistoryChanged();
return true; },
124 onBatchBegin:
function(aMediaList) {},
128 if (aIID.equals(Components.interfaces.nsISupports) ||
129 aIID.equals(Components.interfaces.sbIMediaListListener))
133 throw Components.results.NS_ERROR_NO_INTERFACE;
sbOSDControlService prototype QueryInterface
function SBString(aKey, aDefault, aStringBundle)
var gSongbirdSanitizeOverlay
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
function onUnload()
onUnload - called when the cover preview window unloads.
_getSelectedPageStyle s i