diff --git a/browser/base/content/aboutTabCrashed.css b/browser/base/content/aboutTabCrashed.css
index 4122506da9d6..de0eabe8bdd3 100644
--- a/browser/base/content/aboutTabCrashed.css
+++ b/browser/base/content/aboutTabCrashed.css
@@ -3,6 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
html:not(.crashDumpSubmitted) #reportSent,
-html:not(.crashDumpAvailable) #report-box {
+html:not(.crashDumpAvailable) #reportBox,
+.container[multiple="true"] > .offers > #offerHelpMessageSingle,
+.container[multiple="false"] > .offers > #offerHelpMessageMultiple,
+.container[multiple="false"] > .button-container > #restoreAll {
display: none;
-}
+}
\ No newline at end of file
diff --git a/browser/base/content/aboutTabCrashed.js b/browser/base/content/aboutTabCrashed.js
index c8d3166e288e..61398e73a3d2 100644
--- a/browser/base/content/aboutTabCrashed.js
+++ b/browser/base/content/aboutTabCrashed.js
@@ -62,7 +62,7 @@ var AboutTabCrashed = {
receiveMessage(message) {
switch (message.name) {
case "UpdateCount": {
- this.showRestoreAll(message.data.count > 1);
+ this.setMultiple(message.data.count > 1);
break;
}
case "SetCrashReportAvailable": {
@@ -151,11 +151,11 @@ var AboutTabCrashed = {
* Object property with the following properties:
*
* hasReport (bool):
- * Whether or not there is a crash report
+ * Whether or not there is a crash report.
*
* sendReport (bool):
* Whether or not the the user prefers to send the report
- * by default
+ * by default.
*
* includeURL (bool):
* Whether or not the user prefers to send the URL of
@@ -166,15 +166,20 @@ var AboutTabCrashed = {
* in the report.
*
* email (String):
- * The email address of the user (empty if emailMe is false)
+ * The email address of the user (empty if emailMe is false).
+ *
+ * requestAutoSubmit (bool):
+ * Whether or not we should ask the user to automatically
+ * submit backlogged crash reports.
*
*/
onSetCrashReportAvailable(message) {
- if (message.data.hasReport) {
+ let data = message.data;
+
+ if (data.hasReport) {
this.hasReport = true;
document.documentElement.classList.add("crashDumpAvailable");
- let data = message.data;
document.getElementById("sendReport").checked = data.sendReport;
document.getElementById("includeURL").checked = data.includeURL;
document.getElementById("emailMe").checked = data.emailMe;
@@ -183,6 +188,12 @@ var AboutTabCrashed = {
}
this.showCrashReportUI(data.sendReport);
+ } else {
+ this.showCrashReportUI(false);
+ }
+
+ if (data.requestAutoSubmit) {
+ document.getElementById("requestAutoSubmit").hidden = false;
}
let event = new CustomEvent("AboutTabCrashedReady", {bubbles:true});
@@ -205,24 +216,29 @@ var AboutTabCrashed = {
* True if the crash report form should be shown
*/
showCrashReportUI(shouldShow) {
- let container = document.getElementById("crash-reporter-container");
- container.hidden = !shouldShow;
+ let options = document.getElementById("options");
+ options.hidden = !shouldShow;
},
/**
- * Toggles the display of the "Restore All" button.
+ * Toggles whether or not the page is one of several visible pages
+ * showing the crash reporter. This controls some of the language
+ * on the page, along with what the "primary" button is.
*
- * @param shouldShow (bool)
- * True if the "Restore All" button should be shown
+ * @param hasMultiple (bool)
+ * True if there are multiple crash report pages being shown.
*/
- showRestoreAll(shouldShow) {
- let restoreAll = document.getElementById("restoreAll");
+ setMultiple(hasMultiple) {
+ let main = document.getElementById("main");
+ main.setAttribute("multiple", hasMultiple);
+
let restoreTab = document.getElementById("restoreTab");
- if (shouldShow) {
- restoreAll.removeAttribute("hidden");
+
+ // The "Restore All" button has the "primary" class by default, so
+ // we only need to modify the "Restore Tab" button.
+ if (hasMultiple) {
restoreTab.classList.remove("primary");
} else {
- restoreAll.setAttribute("hidden", true);
restoreTab.classList.add("primary");
}
},
@@ -243,6 +259,7 @@ var AboutTabCrashed = {
let sendReport = false;
let emailMe = false;
let includeURL = false;
+ let autoSubmit = false;
if (this.hasReport) {
sendReport = document.getElementById("sendReport").checked;
@@ -261,6 +278,15 @@ var AboutTabCrashed = {
}
}
+ let requestAutoSubmit = document.getElementById("requestAutoSubmit");
+ if (requestAutoSubmit.hidden) {
+ // The checkbox is hidden if the user has already opted in to sending
+ // backlogged crash reports.
+ autoSubmit = true;
+ } else {
+ autoSubmit = document.getElementById("autoSubmit").checked;
+ }
+
sendAsyncMessage(messageName, {
sendReport,
comments,
@@ -268,6 +294,7 @@ var AboutTabCrashed = {
emailMe,
includeURL,
URL,
+ autoSubmit,
});
},
};
diff --git a/browser/base/content/aboutTabCrashed.xhtml b/browser/base/content/aboutTabCrashed.xhtml
index 69679c4b3f33..7761f0fd04c2 100644
--- a/browser/base/content/aboutTabCrashed.xhtml
+++ b/browser/base/content/aboutTabCrashed.xhtml
@@ -30,28 +30,54 @@