зеркало из https://github.com/mozilla/pjs.git
Back out parts of bug 698986 to resolve bug 716945
This commit is contained in:
Родитель
1e74b54315
Коммит
883a2fbad4
|
@ -7150,25 +7150,10 @@ var gPluginHandler = {
|
|||
BrowserOpenAddonsMgr("addons://list/plugin");
|
||||
},
|
||||
|
||||
// When user clicks try, checks if we should also send crash report in bg
|
||||
retryPluginPage: function (browser, plugin, pluginDumpID, browserDumpID) {
|
||||
let doc = plugin.ownerDocument;
|
||||
|
||||
let statusDiv =
|
||||
doc.getAnonymousElementByAttribute(plugin, "class", "submitStatus");
|
||||
let status = statusDiv.getAttribute("status");
|
||||
|
||||
let submitChk =
|
||||
doc.getAnonymousElementByAttribute(plugin, "class", "pleaseSubmitCheckbox");
|
||||
|
||||
// Check status to make sure we haven't submitted already
|
||||
if (status == "please" && submitChk.checked) {
|
||||
this.submitReport(pluginDumpID, browserDumpID);
|
||||
}
|
||||
this.reloadPage(browser);
|
||||
},
|
||||
|
||||
submitReport: function (pluginDumpID, browserDumpID) {
|
||||
// Callback for user clicking "submit a report" link
|
||||
submitReport : function(pluginDumpID, browserDumpID) {
|
||||
// The crash reporter wants a DOM element it can append an IFRAME to,
|
||||
// which it uses to submit a form. Let's just give it gBrowser.
|
||||
this.CrashSubmit.submit(pluginDumpID);
|
||||
if (browserDumpID)
|
||||
this.CrashSubmit.submit(browserDumpID);
|
||||
|
@ -7386,7 +7371,8 @@ var gPluginHandler = {
|
|||
return;
|
||||
|
||||
let submittedReport = aEvent.getData("submittedCrashReport");
|
||||
let doPrompt = true; // XXX followup to get via gCrashReporter
|
||||
let doPrompt = true; // XXX followup for .getData("doPrompt");
|
||||
let submitReports = true; // XXX followup for .getData("submitReports");
|
||||
let pluginName = aEvent.getData("pluginName");
|
||||
let pluginFilename = aEvent.getData("pluginFilename");
|
||||
let pluginDumpID = aEvent.getData("pluginDumpID");
|
||||
|
@ -7404,7 +7390,6 @@ var gPluginHandler = {
|
|||
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
|
||||
let statusDiv = doc.getAnonymousElementByAttribute(plugin, "class", "submitStatus");
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
let submitReports = gCrashReporter.submitReports;
|
||||
let status;
|
||||
|
||||
// Determine which message to show regarding crash reports.
|
||||
|
@ -7415,21 +7400,18 @@ var gPluginHandler = {
|
|||
status = "noSubmit";
|
||||
}
|
||||
else { // doPrompt
|
||||
// link submit checkbox to gCrashReporter submitReports preference
|
||||
let submitChk = doc.getAnonymousElementByAttribute(
|
||||
plugin, "class", "pleaseSubmitCheckbox");
|
||||
submitChk.checked = submitReports;
|
||||
submitChk.addEventListener("click", function() {
|
||||
gCrashReporter.submitReports = this.checked;
|
||||
}, false);
|
||||
|
||||
status = "please";
|
||||
// XXX can we make the link target actually be blank?
|
||||
let pleaseLink = doc.getAnonymousElementByAttribute(
|
||||
plugin, "class", "pleaseSubmitLink");
|
||||
this.addLinkClickCallback(pleaseLink, "submitReport",
|
||||
pluginDumpID, browserDumpID);
|
||||
}
|
||||
|
||||
// If we don't have a minidumpID, we can't (or didn't) submit anything.
|
||||
// This can happen if the plugin is killed from the task manager.
|
||||
if (!pluginDumpID) {
|
||||
status = "noReport";
|
||||
status = "noReport";
|
||||
}
|
||||
|
||||
statusDiv.setAttribute("status", status);
|
||||
|
@ -7439,23 +7421,10 @@ var gPluginHandler = {
|
|||
let helpIcon = doc.getAnonymousElementByAttribute(plugin, "class", "helpIcon");
|
||||
this.addLinkClickCallback(helpIcon, "openHelpPage");
|
||||
|
||||
// If we're showing the checkbox to trigger report submission, we'll want
|
||||
// to be able to update all the instances of the UI for this crash when
|
||||
// one instance of the checkbox is modified or the status is updated.
|
||||
// If we're showing the link to manually trigger report submission, we'll
|
||||
// want to be able to update all the instances of the UI for this crash to
|
||||
// show an updated message when a report is submitted.
|
||||
if (doPrompt) {
|
||||
let submitReportsPrefObserver = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
observe : function(subject, topic, data) {
|
||||
let submitChk = doc.getAnonymousElementByAttribute(
|
||||
plugin, "class", "pleaseSubmitCheckbox");
|
||||
submitChk.checked = gCrashReporter.submitReports;
|
||||
},
|
||||
handleEvent : function(event) {
|
||||
// Not expected to be called, just here for the closure.
|
||||
}
|
||||
};
|
||||
|
||||
let observer = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
|
@ -7472,21 +7441,16 @@ var gPluginHandler = {
|
|||
handleEvent : function(event) {
|
||||
// Not expected to be called, just here for the closure.
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Use a weak reference, so we don't have to remove it...
|
||||
Services.obs.addObserver(observer, "crash-report-status", true);
|
||||
Services.obs.addObserver(
|
||||
submitReportsPrefObserver, "submit-reports-pref-changed", true);
|
||||
|
||||
// ...alas, now we need something to hold a strong reference to prevent
|
||||
// it from being GC. But I don't want to manually manage the reference's
|
||||
// lifetime (which should be no greater than the page).
|
||||
// Clever solution? Use a closure with an event listener on the document.
|
||||
// Clever solution? Use a closue with an event listener on the document.
|
||||
// When the doc goes away, so do the listener references and the closure.
|
||||
doc.addEventListener("mozCleverClosureHack", observer, false);
|
||||
doc.addEventListener(
|
||||
"mozCleverClosureHack", submitReportsPrefObserver, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -7496,12 +7460,7 @@ var gPluginHandler = {
|
|||
let browser = gBrowser.getBrowserForDocument(doc.defaultView.top.document);
|
||||
|
||||
let link = doc.getAnonymousElementByAttribute(plugin, "class", "reloadLink");
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
this.addLinkClickCallback(
|
||||
link, "retryPluginPage", browser, plugin, pluginDumpID, browserDumpID);
|
||||
#else
|
||||
this.addLinkClickCallback(link, "reloadPage", browser);
|
||||
#endif
|
||||
|
||||
let notificationBox = gBrowser.getNotificationBox(browser);
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
<!ENTITY reloadPlugin.pre "">
|
||||
<!ENTITY reloadPlugin.middle "Reload the page">
|
||||
<!ENTITY reloadPlugin.post " to try again.">
|
||||
<!-- LOCALIZATION NOTE: report.* strings should be as short as possible, ideally 2-3 words. -->
|
||||
<!ENTITY report.checkbox "…and send crash report">
|
||||
<!-- LOCALIZATION NOTE (report.please): This and the other report.* strings should be as short as possible, ideally 2-3 words. -->
|
||||
<!ENTITY report.please "Send crash report">
|
||||
<!ENTITY report.submitting "Sending report…">
|
||||
<!ENTITY report.submitted "Crash report sent.">
|
||||
<!ENTITY report.disabled "Crash reporting disabled.">
|
||||
|
|
|
@ -68,17 +68,15 @@
|
|||
</html:div>
|
||||
<html:div class="msg msgManagePlugins"><html:a class="managePluginsLink" href="">&managePlugins;</html:a></html:div>
|
||||
<html:div class="submitStatus">
|
||||
<!-- link href set at runtime -->
|
||||
<html:div class="msg msgReload">&reloadPlugin.pre;<html:a class="reloadLink" href="">&reloadPlugin.middle;</html:a>&reloadPlugin.post;</html:div>
|
||||
<html:div class="msg msgSubmitPlease">
|
||||
<html:input id="pleaseSubmitCheckbox" type="checkbox" class="pleaseSubmitCheckbox" />
|
||||
<html:label for="pleaseSubmitCheckbox">&report.checkbox;</html:label>
|
||||
</html:div>
|
||||
<!-- links set at runtime -->
|
||||
<html:div class="msg msgPleaseSubmit"><html:a class="pleaseSubmitLink" href="">&report.please;</html:a></html:div>
|
||||
<html:div class="msg msgSubmitting">&report.submitting;<html:span class="throbber"> </html:span></html:div>
|
||||
<html:div class="msg msgSubmitted">&report.submitted;</html:div>
|
||||
<html:div class="msg msgNotSubmitted">&report.disabled;</html:div>
|
||||
<html:div class="msg msgSubmitFailed">&report.failed;</html:div>
|
||||
<html:div class="msg msgNoCrashReport">&report.unavailable;</html:div>
|
||||
<!-- link href set at runtime -->
|
||||
<html:div class="msg msgReload">&reloadPlugin.pre;<html:a class="reloadLink" href="">&reloadPlugin.middle;</html:a>&reloadPlugin.post;</html:div>
|
||||
</html:div>
|
||||
<xul:spacer flex="1"/>
|
||||
<html:div class="msg msgBottomLinks">
|
||||
|
|
|
@ -46,8 +46,7 @@ html|applet:not([height]), html|applet[height=""] {
|
|||
:-moz-handler-disabled .msgDisabled,
|
||||
:-moz-handler-disabled .msgManagePlugins,
|
||||
:-moz-handler-blocked .msgBlocked,
|
||||
:-moz-handler-crashed .msgCrashed,
|
||||
:-moz-handler-crashed .msgReload {
|
||||
:-moz-handler-crashed .msgCrashed {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
@ -56,13 +55,19 @@ html|applet:not([height]), html|applet[height=""] {
|
|||
}
|
||||
|
||||
.submitStatus[status="noReport"] .msgNoCrashReport,
|
||||
.submitStatus[status="please"] .msgPleaseSubmit,
|
||||
.submitStatus[status="noSubmit"] .msgNotSubmitted,
|
||||
.submitStatus[status="submitting"] .msgSubmitting,
|
||||
.submitStatus[status="success"] .msgSubmitted,
|
||||
.submitStatus[status="failed"] .msgSubmitFailed,
|
||||
.submitStatus[status="please"] .msgSubmitPlease {
|
||||
.submitStatus[status]:not([status="please"]) .msgReload {
|
||||
display: block;
|
||||
}
|
||||
.submitStatus[status="please"] .msgReload {
|
||||
/* Take up space when invisible, so stuff doesn't shift upon reveal. */
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.helpIcon {
|
||||
cursor: pointer;
|
||||
|
|
Загрузка…
Ссылка в новой задаче