Bug 1175920 - Add a checkbox to the in-content Privacy preferences to toggle TP in Private Browsing. r=jaws

This commit is contained in:
Panos Astithas 2015-07-01 19:59:36 +03:00
parent 2940d9fe61
commit 2677afc219
4 changed files with 41 additions and 28 deletions

View File

@ -34,6 +34,16 @@ var gPrivacyPane = {
},
#endif
/**
* Linkify the Learn More link of the Private Browsing Mode Tracking
* Protection UI.
*/
_initTrackingProtectionPBM: function () {
let link = document.getElementById("trackingProtectionPBMLearnMore");
let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "tracking-protection-pbm";
link.setAttribute("href", url);
},
/**
* Initialize autocomplete to ensure prefs are in sync.
*/
@ -73,6 +83,7 @@ var gPrivacyPane = {
#ifdef NIGHTLY_BUILD
this._initTrackingProtection();
#endif
this._initTrackingProtectionPBM();
this._initAutocomplete();
setEventListener("privacy.sanitize.sanitizeOnShutdown", "change",

View File

@ -16,6 +16,9 @@
<preference id="privacy.trackingprotection.enabled"
name="privacy.trackingprotection.enabled"
type="bool"/>
<preference id="privacy.trackingprotection.pbmode.enabled"
name="privacy.trackingprotection.pbmode.enabled"
type="bool"/>
<!-- XXX button prefs -->
<preference id="pref.privacy.disable_button.cookie_exceptions"
@ -83,30 +86,12 @@
<!-- Tracking -->
<groupbox id="trackingGroup" data-category="panePrivacy" hidden="true" align="start">
<caption><label>&tracking.label;</label></caption>
<vbox id="trackingprotectionbox" hidden="true">
<hbox align="center">
<checkbox id="trackingProtection"
preference="privacy.trackingprotection.enabled"
accesskey="&trackingProtection.accesskey;"
label="&trackingProtection.label;" />
<image id="trackingProtectionImage"/>
</hbox>
<hbox align="center"
class="indent">
<label id="trackingProtectionLearnMore"
class="text-link"
value="&trackingProtectionLearnMore.label;"/>
</hbox>
</vbox>
<vbox>
<hbox align="center">
<checkbox id="privacyDoNotTrackCheckbox"
label="&dntTrackingNotOkay.label2;"
accesskey="&dntTrackingNotOkay.accesskey;"
preference="privacy.donottrackheader.enabled"/>
</hbox>
<hbox align="center"
class="indent">
<label id="doNotTrackInfo"
class="text-link"
href="https://www.mozilla.org/dnt">
@ -114,6 +99,28 @@
</label>
</hbox>
</vbox>
<vbox id="trackingprotectionbox" hidden="true">
<hbox align="center">
<checkbox id="trackingProtection"
preference="privacy.trackingprotection.enabled"
accesskey="&trackingProtection.accesskey;"
label="&trackingProtection.label;" />
<label id="trackingProtectionLearnMore"
class="text-link"
value="&trackingProtectionLearnMore.label;"/>
</hbox>
</vbox>
<vbox id="trackingprotectionpbmbox">
<hbox align="center">
<checkbox id="trackingProtectionPBM"
preference="privacy.trackingprotection.pbmode.enabled"
accesskey="&trackingProtectionPBM.accesskey;"
label="&trackingProtectionPBM.label;" />
<label id="trackingProtectionPBMLearnMore"
class="text-link"
value="&trackingProtectionPBMLearnMore.label;"/>
</hbox>
</vbox>
</groupbox>
<!-- History -->

View File

@ -9,6 +9,9 @@
<!ENTITY trackingProtection.label "Prevent sites from tracking me">
<!ENTITY trackingProtection.accesskey "m">
<!ENTITY trackingProtectionLearnMore.label "Learn more">
<!ENTITY trackingProtectionPBM.label "Prevent sites from tracking my online activity in Private Windows">
<!ENTITY trackingProtectionPBM.accesskey "m">
<!ENTITY trackingProtectionPBMLearnMore.label "Learn more">
<!ENTITY doNotTrackInfo.label "Learn More">
<!ENTITY history.label "History">

View File

@ -267,16 +267,8 @@ description > html|a {
-moz-margin-start: 33px;
}
#trackingProtectionImage {
width: 16px;
height: 16px;
list-style-image: url(chrome://browser/skin/bad-content-blocked-16.png);
}
@media (min-resolution: 2dppx) {
#trackingProtectionImage {
list-style-image: url(chrome://browser/skin/bad-content-blocked-16@2x.png);
}
.text-link {
margin-bottom: 0;
}
#showUpdateHistory {