Bug 1287178 - Replace erroneous Enable Crash Reporter pref with one that lets users opt-in to sending backlogged reports. r?jaws draft
authorMike Conley <mconley@mozilla.com>
Wed, 07 Sep 2016 16:50:11 -0400
changeset 412769 c1eca3ad7b2f161a6cd1db97f1cfce8c8fbf6b12
parent 412768 b68e073a58dd3bbf6eb26b04b4c678dde594fcf4
child 412770 1aa500f2de613b2ae6f81efdf1124e503c4e86fb
push id29254
push usermconley@mozilla.com
push dateMon, 12 Sep 2016 20:05:34 +0000
reviewersjaws
bugs1287178
milestone51.0a1
Bug 1287178 - Replace erroneous Enable Crash Reporter pref with one that lets users opt-in to sending backlogged reports. r?jaws The "Enable Crash Reporter" pref is erroneous because what it actually controls is whether or not the "Submit crash report" checkbox is checked by default when the crash report dialog comes up. MozReview-Commit-ID: Ud6SLKXvxw
browser/app/profile/firefox.js
browser/components/preferences/in-content/advanced.js
browser/components/preferences/in-content/advanced.xul
browser/locales/en-US/chrome/browser/preferences/advanced.dtd
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1509,8 +1509,10 @@ pref("webchannel.allowObject.urlWhitelis
 // Whether or not the browser should scan for unsubmitted
 // crash reports, and then show a notification for submitting
 // those reports.
 #ifdef RELEASE_BUILD
 pref("browser.crashReports.unsubmittedCheck.enabled", false);
 #else
 pref("browser.crashReports.unsubmittedCheck.enabled", true);
 #endif
+
+pref("browser.crashReports.unsubmittedCheck.autoSubmit", false);
\ No newline at end of file
--- a/browser/components/preferences/in-content/advanced.js
+++ b/browser/components/preferences/in-content/advanced.js
@@ -55,20 +55,17 @@ var gAdvancedPane = {
     setEventListener("layers.acceleration.disabled", "change",
                      gAdvancedPane.updateHardwareAcceleration);
     setEventListener("advancedPrefs", "select",
                      gAdvancedPane.tabSelectionChanged);
     if (AppConstants.MOZ_TELEMETRY_REPORTING) {
       setEventListener("submitHealthReportBox", "command",
                        gAdvancedPane.updateSubmitHealthReport);
     }
-    if (AppConstants.MOZ_CRASHREPORTER) {
-      setEventListener("submitCrashesBox", "command",
-                       gAdvancedPane.updateSubmitCrashes);
-    }
+
     setEventListener("connectionSettings", "command",
                      gAdvancedPane.showConnections);
     setEventListener("clearCacheButton", "command",
                      gAdvancedPane.clearCache);
     setEventListener("clearOfflineAppCacheButton", "command",
                      gAdvancedPane.clearOfflineAppCache);
     setEventListener("offlineNotifyExceptions", "command",
                      gAdvancedPane.showOfflineExceptions);
@@ -238,38 +235,16 @@ var gAdvancedPane = {
 
   /**
    *
    */
   initSubmitCrashes: function ()
   {
     this._setupLearnMoreLink("toolkit.crashreporter.infoURL",
                              "crashReporterLearnMore");
-
-    var checkbox = document.getElementById("submitCrashesBox");
-    try {
-      var cr = Components.classes["@mozilla.org/toolkit/crash-reporter;1"].
-               getService(Components.interfaces.nsICrashReporter);
-      checkbox.checked = cr.submitReports;
-    } catch (e) {
-      checkbox.style.display = "none";
-    }
-  },
-
-  /**
-   *
-   */
-  updateSubmitCrashes: function ()
-  {
-    var checkbox = document.getElementById("submitCrashesBox");
-    try {
-      var cr = Components.classes["@mozilla.org/toolkit/crash-reporter;1"].
-               getService(Components.interfaces.nsICrashReporter);
-      cr.submitReports = checkbox.checked;
-    } catch (e) { }
   },
 
   /**
    * The preference/checkbox is configured in XUL.
    *
    * In all cases, set up the Learn More link sanely.
    */
   initTelemetry: function ()
--- a/browser/components/preferences/in-content/advanced.xul
+++ b/browser/components/preferences/in-content/advanced.xul
@@ -49,16 +49,23 @@
               type="int"/>
 
 #ifdef MOZ_TELEMETRY_REPORTING
   <preference id="toolkit.telemetry.enabled"
               name="toolkit.telemetry.enabled"
               type="bool"/>
 #endif
 
+  <!-- Data Choices tab -->
+#ifdef MOZ_CRASHREPORTER
+  <preference id="browser.crashReports.unsubmittedCheck.autoSubmit"
+              name="browser.crashReports.unsubmittedCheck.autoSubmit"
+              type="bool"/>
+#endif
+
   <!-- Network tab -->
   <preference id="browser.cache.disk.capacity"
               name="browser.cache.disk.capacity"
               type="int"/>
   <preference id="browser.offline-apps.notify"
               name="browser.offline-apps.notify"
               type="bool"/>
 
@@ -224,21 +231,23 @@
             </groupbox>
           </hbox>
         </vbox>
       </groupbox>
 #endif
 #ifdef MOZ_CRASHREPORTER
       <groupbox>
         <caption>
-          <checkbox id="submitCrashesBox" label="&enableCrashReporter.label;"
-                    accesskey="&enableCrashReporter.accesskey;"/>
+          <checkbox id="automaticallySubmitCrashesBox"
+                    preference="browser.crashReports.unsubmittedCheck.autoSubmit"
+                    label="&alwaysSubmitCrashReports.label;"
+                    accesskey="&alwaysSubmitCrashReports.accesskey;"/>
         </caption>
         <hbox class="indent">
-          <label flex="1">&crashReporterDesc.label;</label>
+          <label flex="1">&crashReporterDesc2.label;</label>
           <spacer flex="10"/>
           <label id="crashReporterLearnMore"
                  class="text-link">&crashReporterLearnMore.label;</label>
         </hbox>
       </groupbox>
 #endif
     </tabpanel>
 #endif
--- a/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
@@ -35,20 +35,20 @@
 <!ENTITY enableHealthReport.accesskey    "R">
 <!ENTITY healthReportLearnMore.label     "Learn More">
 
 <!ENTITY telemetryDesc.label             "Shares performance, usage, hardware and customization data about your browser with &vendorShortName; to help us make &brandShortName; better">
 <!ENTITY enableTelemetryData.label       "Share additional data (i.e., Telemetry)">
 <!ENTITY enableTelemetryData.accesskey   "T">
 <!ENTITY telemetryLearnMore.label        "Learn More">
 
-<!ENTITY crashReporterDesc.label         "&brandShortName; submits crash reports to help &vendorShortName; make your browser more stable and secure">
-<!ENTITY enableCrashReporter.label       "Enable Crash Reporter">
-<!ENTITY enableCrashReporter.accesskey   "C">
-<!ENTITY crashReporterLearnMore.label    "Learn More">
+<!ENTITY crashReporterDesc2.label         "Crash reports help &vendorShortName; fix problems and make your browser more stable and secure">
+<!ENTITY alwaysSubmitCrashReports.label   "Allow &brandShortName; to send backlogged crash reports on your behalf">
+<!ENTITY alwaysSubmitCrashReports.accesskey "c">
+<!ENTITY crashReporterLearnMore.label     "Learn More">
 
 <!ENTITY networkTab.label                "Network">
 
 <!ENTITY connection.label                "Connection">
 
 <!ENTITY connectionDesc.label            "Configure how &brandShortName; connects to the Internet">
 <!ENTITY connectionSettings.label        "Settingsā€¦">
 <!ENTITY connectionSettings.accesskey    "e">