Bug 1231375 - Add a dialog to manage DNT settings. r=past
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Fri, 08 Jan 2016 14:11:38 +0000
changeset 320159 6fe85dbddb0cc0b3292f28e8cbc64529c8586939
parent 320158 37795691ec97a85fdb85f2d78d9c13875c0ccbe8
child 320160 70b34c15015c450c7d786a98336df575ccf21885
push id9143
push userahunt@mozilla.com
push dateFri, 08 Jan 2016 21:30:53 +0000
reviewerspast
bugs1231375
milestone46.0a1
Bug 1231375 - Add a dialog to manage DNT settings. r=past
browser/components/preferences/donottrack.xul
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/jar.mn
browser/locales/en-US/chrome/browser/preferences/donottrack.dtd
browser/locales/en-US/chrome/browser/preferences/privacy.dtd
browser/locales/jar.mn
browser/themes/shared/incontentprefs/preferences.inc.css
new file mode 100644
--- /dev/null
+++ b/browser/components/preferences/donottrack.xul
@@ -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>
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -103,16 +103,20 @@ var gPrivacyPane = {
     setEventListener("historyRememberCookies", "click", function () {
       gPrivacyPane.showCookies();
       return false;
     });
     setEventListener("historyDontRememberClear", "click", function () {
       gPrivacyPane.clearPrivateDataNow(true);
       return false;
     });
+    setEventListener("doNotTrackSettings", "click", function () {
+      gPrivacyPane.showDoNotTrackSettings();
+      return false;
+    });
     setEventListener("privateBrowsingAutoStart", "command",
                      gPrivacyPane.updateAutostart);
     setEventListener("cookieExceptions", "command",
                      gPrivacyPane.showCookieExceptions);
     setEventListener("showCookiesButton", "command",
                      gPrivacyPane.showCookies);
     setEventListener("clearDataSettings", "command",
                      gPrivacyPane.showClearPrivateDataSettings);
@@ -381,16 +385,24 @@ var gPrivacyPane = {
                             .getString("brandShortName");
     var params = { brandShortName: brandName,
                    windowTitle: bundlePreferences.getString("blockliststitle"),
                    introText: bundlePreferences.getString("blockliststext") };
     gSubDialog.open("chrome://browser/content/preferences/blocklists.xul",
                     null, params);
   },
 
+  /**
+   * Displays the Do Not Track settings dialog.
+   */
+  showDoNotTrackSettings() {
+    gSubDialog.open("chrome://browser/content/preferences/donottrack.xul",
+                    "resizable=no");
+  },
+
   // HISTORY
 
   /*
    * Preferences:
    *
    * places.history.enabled
    * - whether history is enabled or not
    * browser.formfill.enable
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -5,19 +5,16 @@
 <!-- Privacy panel -->
 
 <script type="application/javascript"
         src="chrome://browser/content/preferences/in-content/privacy.js"/>
 
 <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"/>
   <preference id="privacy.trackingprotection.pbmode.enabled"
               name="privacy.trackingprotection.pbmode.enabled"
               type="bool"/>
 
   <!-- XXX button prefs -->
@@ -83,29 +80,16 @@
   <label class="header-name" flex="1">&panePrivacy.title;</label>
   <button class="help-button"
           aria-label="&helpButton.label;"/>
 </hbox>
 
 <!-- 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"
                 preference="privacy.trackingprotection.enabled"
                 accesskey="&trackingProtection5.accesskey;"
                 label="&trackingProtection5.label;" />
       <label id="trackingProtectionLearnMore"
              class="text-link"
@@ -122,16 +106,21 @@
              class="text-link"
              value="&trackingProtectionPBMLearnMore.label;"/>
       <spacer flex="1" />
       <button id="changeBlockList"
               label="&changeBlockList.label;" accesskey="&changeBlockList.accesskey;"
               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 -->
 <groupbox id="historyGroup" data-category="panePrivacy" hidden="true">
   <caption><label>&history.label;</label></caption>
   <hbox align="center">
     <label id="historyModeLabel"
            control="historyMode"
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -7,16 +7,17 @@ browser.jar:
     content/browser/preferences/applicationManager.js
     content/browser/preferences/blocklists.xul
     content/browser/preferences/blocklists.js
 *   content/browser/preferences/colors.xul
 *   content/browser/preferences/cookies.xul
 *   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
     content/browser/preferences/handlers.css
 *   content/browser/preferences/languages.xul
     content/browser/preferences/languages.js
     content/browser/preferences/permissions.xul
 *   content/browser/preferences/permissions.js
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/chrome/browser/preferences/donottrack.dtd
@@ -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">
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -1,26 +1,29 @@
 <!-- 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 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">
 <!ENTITY trackingProtectionPBM5.label         "Use Tracking Protection in Private Windows">
 <!ENTITY trackingProtectionPBM5.accesskey     "v">
 <!ENTITY trackingProtectionPBMLearnMore.label "Learn more">
 <!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">
 
 <!ENTITY  locbar.suggest.label          "When using the location bar, suggest:">
 <!ENTITY  locbar.history.label          "History">
 <!ENTITY  locbar.history.accesskey      "H">
 <!ENTITY  locbar.bookmarks.label        "Bookmarks">
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -65,16 +65,17 @@
     locale/browser/preferences/advanced.dtd           (%chrome/browser/preferences/advanced.dtd)
     locale/browser/preferences/applicationManager.dtd        (%chrome/browser/preferences/applicationManager.dtd)
     locale/browser/preferences/applicationManager.properties (%chrome/browser/preferences/applicationManager.properties)
     locale/browser/preferences/blocklists.dtd         (%chrome/browser/preferences/blocklists.dtd)
     locale/browser/preferences/colors.dtd             (%chrome/browser/preferences/colors.dtd)
     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)
     locale/browser/preferences/languages.dtd          (%chrome/browser/preferences/languages.dtd)
     locale/browser/preferences/permissions.dtd        (%chrome/browser/preferences/permissions.dtd)
     locale/browser/preferences/preferences.dtd        (%chrome/browser/preferences/preferences.dtd)
     locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
     locale/browser/preferences/privacy.dtd            (%chrome/browser/preferences/privacy.dtd)
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -217,17 +217,17 @@ treecol {
 }
 
 .actionsMenu > menupopup > menuitem > .menu-iconic-left {
   -moz-margin-end: 8px !important;
 }
 
 /* Privacy pane */
 
-#doNotTrackInfo,
+.doNotTrackLearnMore,
 #trackingProtectionPBMLearnMore,
 #trackingProtectionLearnMore {
   -moz-margin-start: 1.5em !important;
   margin-top: 0;
 }
 
 /* Collapse the non-active vboxes in decks to use only the height the
    active vbox needs */