Bug 1196017 - Deal with TP turned on globally in about:privatebrowsing. r=paolo

This commit is contained in:
Francois Marier 2015-08-24 16:10:14 -07:00
Родитель 9bb2991147
Коммит 6ce32f63b0
3 изменённых файлов: 13 добавлений и 3 удалений

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

@ -21,6 +21,9 @@ body[tpEnabled] .showTpDisabled,
body:not([tpEnabled]) .showTpEnabled {
display: none !important;
}
body[globalTpEnabled] .showGlobalTpDisabled {
display: none !important;
}
@media screen and (min-width: 1200px) and (min-height: 700px) {
body.private {

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

@ -14,18 +14,25 @@ const FAVICON_PRIVACY = "chrome://browser/skin/Privacy-16.png";
let stringBundle = Services.strings.createBundle(
"chrome://browser/locale/aboutPrivateBrowsing.properties");
let prefBranch = Services.prefs.getBranch("privacy.trackingprotection.pbmode.");
let prefBranch = Services.prefs.getBranch("privacy.trackingprotection.");
let prefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
observe: function () {
if (prefBranch.getBoolPref("enabled")) {
document.body.setAttribute("globalTpEnabled", "true");
} else {
document.body.removeAttribute("globalTpEnabled");
}
if (prefBranch.getBoolPref("pbmode.enabled") ||
prefBranch.getBoolPref("enabled")) {
document.body.setAttribute("tpEnabled", "true");
} else {
document.body.removeAttribute("tpEnabled");
}
},
};
prefBranch.addObserver("pbmode.enabled", prefObserver, true);
prefBranch.addObserver("enabled", prefObserver, true);
function setFavIcon(url) {

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

@ -73,11 +73,11 @@
<!-- Use text links to implement plain styled buttons without an href. -->
<label xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="disableTrackingProtection"
class="text-link showTpEnabled"
class="text-link showTpEnabled showGlobalTpDisabled"
value="&trackingProtection.disable;"/>
<label xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="enableTrackingProtection"
class="text-link showTpDisabled"
class="text-link showTpDisabled showGlobalTpDisabled"
value="&trackingProtection.enable;"/>
<p id="tpStartTour"
class="showTpEnabled"><a id="startTour">&trackingProtection.startTour1;</a></p>