Skip to content

Commit

Permalink
Bug 1231375 - Add a dialog to manage DNT settings. r=past
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Amadini committed Jan 8, 2016
1 parent 0bd8b01 commit c2e781d
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 20 deletions.
35 changes: 35 additions & 0 deletions browser/components/preferences/donottrack.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>

<!-- 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/. -->

<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>

<!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/donottrack.dtd" >

<prefwindow id="DoNotTrackDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&window.title;"
style="width: &window.width;; height: &window.height;;"
dlgbuttons="accept,cancel">
<prefpane>
<preferences>
<preference id="privacy.donottrackheader.enabled"
name="privacy.donottrackheader.enabled"
type="bool"/>
</preferences>
<hbox align="center" pack="start">
<!-- Work around focus ring not showing properly. -->
<spacer style="width: 1em;"/>
<checkbox label="&doNotTrackCheckbox.label;"
accesskey="&doNotTrackCheckbox.accesskey;"
preference="privacy.donottrackheader.enabled"/>
<label class="text-link doNotTrackLearnMore"
value="&doNotTrackLearnMore.label;"
href="https://www.mozilla.org/dnt"/>
</hbox>
</prefpane>
</prefwindow>
12 changes: 12 additions & 0 deletions browser/components/preferences/in-content/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ var gPrivacyPane = {
gPrivacyPane.clearPrivateDataNow(true);
return false;
});
setEventListener("doNotTrackSettings", "click", function () {
gPrivacyPane.showDoNotTrackSettings();
return false;
});
setEventListener("privateBrowsingAutoStart", "command",
gPrivacyPane.updateAutostart);
setEventListener("cookieExceptions", "command",
Expand Down Expand Up @@ -386,6 +390,14 @@ var gPrivacyPane = {
null, params);
},

/**
* Displays the Do Not Track settings dialog.
*/
showDoNotTrackSettings() {
gSubDialog.open("chrome://browser/content/preferences/donottrack.xul",
"resizable=no");
},

// HISTORY

/*
Expand Down
21 changes: 5 additions & 16 deletions browser/components/preferences/in-content/privacy.xul
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<preferences id="privacyPreferences" hidden="true" data-category="panePrivacy">

<!-- Tracking -->
<preference id="privacy.donottrackheader.enabled"
name="privacy.donottrackheader.enabled"
type="bool"/>
<preference id="privacy.trackingprotection.enabled"
name="privacy.trackingprotection.enabled"
type="bool"/>
Expand Down Expand Up @@ -88,19 +85,6 @@
<!-- Tracking -->
<groupbox id="trackingGroup" data-category="panePrivacy" hidden="true">
<caption><label>&tracking.label;</label></caption>
<vbox>
<hbox align="center">
<checkbox id="privacyDoNotTrackCheckbox"
label="&dntTrackingNotOkay4.label;"
accesskey="&dntTrackingNotOkay4.accesskey;"
preference="privacy.donottrackheader.enabled"/>
<label id="doNotTrackInfo"
class="text-link"
href="https://www.mozilla.org/dnt">
&doNotTrackInfo.label;
</label>
</hbox>
</vbox>
<vbox id="trackingprotectionbox" hidden="true">
<hbox align="center">
<checkbox id="trackingProtection"
Expand All @@ -127,6 +111,11 @@
preference="pref.privacy.disable_button.change_blocklist"/>
</hbox>
</vbox>
<vbox>
<description>&doNotTrack.pre.label;<html:a
class="inline-link" id="doNotTrackSettings" href="#"
>&doNotTrack.settings.label;</html:a>&doNotTrack.post.label;</description>
</vbox>
</groupbox>

<!-- History -->
Expand Down
1 change: 1 addition & 0 deletions browser/components/preferences/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ browser.jar:
* content/browser/preferences/cookies.js
* content/browser/preferences/connection.xul
content/browser/preferences/connection.js
content/browser/preferences/donottrack.xul
* content/browser/preferences/fonts.xul
content/browser/preferences/fonts.js
content/browser/preferences/handlers.xml
Expand Down
12 changes: 12 additions & 0 deletions browser/locales/en-US/chrome/browser/preferences/donottrack.dtd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- 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/. -->

<!ENTITY window.title "Do Not Track">
<!ENTITY window.width "40em">
<!ENTITY window.height "8em">

<!ENTITY doNotTrackCheckbox.label "Use Do Not Track">
<!ENTITY doNotTrackCheckbox.accesskey "U">

<!ENTITY doNotTrackLearnMore.label "Learn More">
9 changes: 6 additions & 3 deletions browser/locales/en-US/chrome/browser/preferences/privacy.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

<!ENTITY tracking.label "Tracking">

<!ENTITY dntTrackingNotOkay4.label "Request that sites not track you">
<!ENTITY dntTrackingNotOkay4.accesskey "n">
<!ENTITY doNotTrackInfo.label "Learn More">
<!ENTITY trackingProtection5.label "Use Tracking Protection">
<!ENTITY trackingProtection5.accesskey "i">
<!ENTITY trackingProtectionLearnMore.label "Learn more">
Expand All @@ -16,6 +13,12 @@
<!ENTITY changeBlockList.label "Change Block List">
<!ENTITY changeBlockList.accesskey "C">

<!-- LOCALIZATION NOTE (doNotTrack.pre.label): include a trailing space as needed -->
<!-- LOCALIZATION NOTE (doNotTrack.post.label): include a starting space as needed -->
<!ENTITY doNotTrack.pre.label "You can also ">
<!ENTITY doNotTrack.settings.label "manage your Do Not Track settings">
<!ENTITY doNotTrack.post.label ".">

<!ENTITY history.label "History">

<!ENTITY locationBar.label "Location Bar">
Expand Down
1 change: 1 addition & 0 deletions browser/locales/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd)
locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd)
locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd)
locale/browser/preferences/donottrack.dtd (%chrome/browser/preferences/donottrack.dtd)
locale/browser/preferences/applications.dtd (%chrome/browser/preferences/applications.dtd)
locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd)
locale/browser/preferences/main.dtd (%chrome/browser/preferences/main.dtd)
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/shared/incontentprefs/preferences.inc.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ treecol {

/* Privacy pane */

#doNotTrackInfo,
.doNotTrackLearnMore,
#trackingProtectionPBMLearnMore,
#trackingProtectionLearnMore {
-moz-margin-start: 1.5em !important;
Expand Down

0 comments on commit c2e781d

Please sign in to comment.