Backed out changeset 14434d2b75b9 (bug 866304) for suspicion of causing metro mochitest failure

This commit is contained in:
Carsten "Tomcat" Book 2013-08-06 12:06:50 +02:00
Родитель bceaaae272
Коммит 0b0bdf6c7a
2 изменённых файлов: 72 добавлений и 30 удалений

Просмотреть файл

@ -265,40 +265,16 @@ var BrowserUI = {
let didPrompt = Services.prefs.getBoolPref("app.crashreporter.prompted");
if (!shouldReport && !didPrompt) {
let crashBundle = Services.strings.createBundle("chrome://browser/locale/crashprompt.properties");
let title = crashBundle.GetStringFromName("crashprompt.dialog.title");
let acceptbutton = crashBundle.GetStringFromName("crashprompt.dialog.acceptbutton");
let refusebutton = crashBundle.GetStringFromName("crashprompt.dialog.refusebutton");
let bodyText = crashBundle.GetStringFromName("crashprompt.dialog.statement1");
let buttonPressed =
Services.prompt.confirmEx(
window,
title,
bodyText,
Ci.nsIPrompt.BUTTON_POS_0 * Ci.nsIPrompt.BUTTON_TITLE_IS_STRING
+ Ci.nsIPrompt.BUTTON_POS_1 * Ci.nsIPrompt.BUTTON_TITLE_IS_STRING
+ Ci.nsIPrompt.BUTTON_POS_1_DEFAULT,
acceptbutton,
refusebutton,
null,
null,
{ value: false });
// We have a crash to submit, we haven't prompted for approval yet,
// and the auto-submit pref is false, prompt. The dialog will call
// startupCrashCheck again if the user approves.
Services.prefs.setBoolPref("app.crashreporter.prompted", true);
if (buttonPressed == 0) {
Services.prefs.setBoolPref('app.crashreporter.autosubmit', true);
BrowserUI.crashReportingPrefChanged(true);
shouldReport = true;
} else {
Services.prefs.setBoolPref('app.crashreporter.autosubmit', false);
BrowserUI.crashReportingPrefChanged(false);
}
DialogUI.importModal(document, "chrome://browser/content/prompt/crash.xul");
return;
}
// We've already prompted, return if the user doesn't want to report.
if (!shouldReport) {
if (!shouldReport && didPrompt) {
return;
}
@ -758,6 +734,11 @@ var BrowserUI = {
return;
}
// Check open modal elements
if (DialogUI.modals.length > 0) {
return;
}
// Check open panel
if (PanelUI.isVisible) {
PanelUI.hide();
@ -1333,6 +1314,66 @@ var DialogUI = {
window.addEventListener("mousedown", this, true);
},
/*******************************************
* Modal popups
*/
get modals() {
return document.getElementsByClassName("modal-block");
},
importModal: function importModal(aParent, aSrc, aArguments) {
// load the dialog with a synchronous XHR
let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
xhr.open("GET", aSrc, false);
xhr.overrideMimeType("text/xml");
xhr.send(null);
if (!xhr.responseXML)
return null;
let currentNode;
let nodeIterator = xhr.responseXML.createNodeIterator(xhr.responseXML, NodeFilter.SHOW_TEXT, null, false);
while (!!(currentNode = nodeIterator.nextNode())) {
let trimmed = currentNode.nodeValue.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
if (!trimmed.length)
currentNode.parentNode.removeChild(currentNode);
}
let doc = xhr.responseXML.documentElement;
let dialog = null;
// we need to insert before context-container if we want allow pasting (using
// the context menu) into dialogs
let contentMenuContainer = document.getElementById("context-container");
let parentNode = contentMenuContainer.parentNode;
// emit DOMWillOpenModalDialog event
let event = document.createEvent("Events");
event.initEvent("DOMWillOpenModalDialog", true, false);
let dispatcher = aParent || getBrowser();
dispatcher.dispatchEvent(event);
// create a full-screen semi-opaque box as a background or reuse
// the existing one.
let back = document.getElementById("dialog-modal-block");
if (!back) {
back = document.createElement("box");
} else {
while (back.hasChildNodes()) {
back.removeChild(back.firstChild);
}
}
back.setAttribute("class", "modal-block");
back.setAttribute("id", "dialog-modal-block");
dialog = back.appendChild(document.importNode(doc, true));
parentNode.insertBefore(back, contentMenuContainer);
dialog.arguments = aArguments;
dialog.parent = aParent;
return dialog;
},
/*******************************************
* Popups
*/

Просмотреть файл

@ -20,6 +20,7 @@
locale/browser/sync.properties (%chrome/sync.properties)
locale/browser/passwordmgr.properties (%chrome/passwordmgr.properties)
locale/browser/phishing.dtd (%chrome/phishing.dtd)
locale/browser/crashprompt.dtd (%chrome/crashprompt.dtd)
locale/browser/aboutAddons.dtd (%chrome/aboutAddons.dtd)
@AB_CD@.jar: