Bug 1599444, allow users to delete past telemetry data within about:preferences#privacy r=Gijs, a=jcristau
authorEmma Malysz <emalysz@mozilla.com>
Tue, 10 Dec 2019 22:06:24 +0000
changeset 566934 18136adea47c43694d3834281217b6dca18c4237
parent 566933 9ae245f40bc878b35e3ff2f95ea6cf3b7dcc4a12
child 566935 438b98968e1b6d83fad017180e494a7ee76c7776
push id12472
push userjcristau@mozilla.com
push dateMon, 23 Dec 2019 16:11:05 +0000
treeherdermozilla-beta@5fb1944b566d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, jcristau
bugs1599444
milestone72.0
Bug 1599444, allow users to delete past telemetry data within about:preferences#privacy r=Gijs, a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D57826
browser/components/preferences/in-content/privacy.inc.xhtml
browser/components/preferences/in-content/privacy.js
browser/themes/shared/incontentprefs/preferences.inc.css
browser/themes/shared/incontentprefs/privacy.css
--- a/browser/components/preferences/in-content/privacy.inc.xhtml
+++ b/browser/components/preferences/in-content/privacy.inc.xhtml
@@ -848,16 +848,30 @@
   <label class="search-header" hidden="true"><html:h2 data-l10n-id="collection-header"/></label>
 
   <description>
     <label class="tail-with-learn-more" data-l10n-id="collection-description"/>
     <label id="dataCollectionPrivacyNotice"
            class="learnMore" is="text-link"
            data-l10n-id="collection-privacy-notice"/>
   </description>
+  <description>
+    <hbox id="telemetry-container" align="stretch" flex="1" hidden="true">
+      <hbox align="top">
+        <image class="info-icon-telemetry" flex="1"></image>
+      </hbox>
+      <hbox align="center" id="dataDescriptionBox" flex="1">
+        <html:span id="telemetryDisabledDescription" class="tail-with-learn-more">You’re no longer allowing Mozilla to capture technical and interaction data. All past data will be deleted within 30 days.</html:span>
+      </hbox>
+      <hbox>
+          <button id="telemetryDataDeletionLearnMore"
+                 class="learnMore" is="text-link">Learn more</button>
+      </hbox>
+    </hbox>
+  </description>
   <vbox data-subcategory="reports">
     <description flex="1">
       <checkbox id="submitHealthReportBox"
                 data-l10n-id="collection-health-report"
                 class="tail-with-learn-more"/>
       <label id="FHRLearnMore"
              class="learnMore" is="text-link"
              data-l10n-id="collection-health-report-link"/>
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -496,16 +496,21 @@ var gPrivacyPane = {
       "command",
       gPrivacyPane.showCertificates
     );
     setEventListener(
       "viewSecurityDevicesButton",
       "command",
       gPrivacyPane.showSecurityDevices
     );
+    setEventListener(
+      "telemetryDataDeletionLearnMore",
+      "command",
+      gPrivacyPane.showDataDeletion
+    );
 
     this._pane = document.getElementById("panePrivacy");
 
     this._initPasswordGenerationUI();
     this._initMasterPasswordUI();
     // set up the breach alerts Learn More link with the correct URL
     const breachAlertsLearnMoreLink = document.getElementById(
       "breachAlertsLearnMoreLink"
@@ -2149,16 +2154,26 @@ var gPrivacyPane = {
 
   /**
    * Displays a dialog from which the user can manage his security devices.
    */
   showSecurityDevices() {
     gSubDialog.open("chrome://pippki/content/device_manager.xhtml");
   },
 
+  /**
+   * Displays the learn more health report page when a user opts out of data collection.
+   */
+  showDataDeletion() {
+    let url =
+      Services.urlFormatter.formatURLPref("app.support.baseURL") +
+      "telemetry-clientid";
+    window.open(url, "_blank");
+  },
+
   initDataCollection() {
     this._setupLearnMoreLink(
       "toolkit.datacollection.infoURL",
       "dataCollectionPrivacyNotice"
     );
   },
 
   initSubmitCrashes() {
@@ -2210,17 +2225,23 @@ var gPrivacyPane = {
       AppConstants.MOZ_TELEMETRY_REPORTING;
   },
 
   /**
    * Update the health report preference with state from checkbox.
    */
   updateSubmitHealthReport() {
     let checkbox = document.getElementById("submitHealthReportBox");
+    let telemetryContainer = document.getElementById("telemetry-container");
+
     Services.prefs.setBoolPref(PREF_UPLOAD_ENABLED, checkbox.checked);
+
+    if (Services.locale.requestedLocale == "en-US") {
+      telemetryContainer.hidden = checkbox.checked;
+    }
   },
 
   /**
    * Initialize the opt-out-study preference checkbox into about:preferences and
    * handles events coming from the UI for it.
    */
   initOptOutStudyCheckbox(doc) {
     // The checkbox should be disabled if any of the below are true. This
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -829,16 +829,23 @@ image.update-throbber {
 
 .info-icon {
   list-style-image: url("chrome://browser/skin/identity-icon.svg");
   width: 16px;
   height: 16px;
   margin-top: calc((32px - 16px) / 2);
 }
 
+.info-icon-telemetry {
+  list-style-image: url("chrome://browser/skin/identity-icon.svg");
+  width: 16px;
+  height: 16px;
+  margin-inline: 2px 8px;
+}
+
 .sticky-container {
   position: sticky;
   background-color: var(--in-content-page-background);
   top: 0;
   z-index: 1;
   /* The sticky-container should have the capability to cover all spotlight area. */
   width: calc(100% + 8px);
   margin-inline: -4px;
--- a/browser/themes/shared/incontentprefs/privacy.css
+++ b/browser/themes/shared/incontentprefs/privacy.css
@@ -294,16 +294,30 @@
 #trackingProtectionMenu {
   margin: 0;
 }
 
 #changeBlockListLink {
   margin-inline-start: 56px;
 }
 
+#telemetry-container {
+  border-radius: 4px;
+  background-color: rgba(12,12,13,0.2);
+  font-size: 85%;
+  padding: 3px;
+  margin-top: 4px;
+  margin-bottom: 4px;
+  width: 100%;
+}
+
+#dataDescriptionBox {
+  line-height: 1.3;
+}
+
 .content-blocking-category-description {
   font-size: 90%;
   opacity: 0.6;
 }
 
 .warning-description {
   background: url(chrome://browser/skin/controlcenter/warning.svg) no-repeat 0 5px;
   opacity: 0.6;