mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 715673 - Hande browser-lastwindow-close events. r=mfinkle
This commit is contained in:
parent
01ee52648b
commit
9ed4be4301
@ -489,8 +489,27 @@ var BrowserApp = {
|
||||
},
|
||||
|
||||
quit: function quit() {
|
||||
window.QueryInterface(Ci.nsIDOMChromeWindow).minimize();
|
||||
window.close();
|
||||
// Figure out if there's at least one other browser window around.
|
||||
let lastBrowser = true;
|
||||
let e = Services.wm.getEnumerator("navigator:browser");
|
||||
while (e.hasMoreElements() && lastBrowser) {
|
||||
let win = e.getNext();
|
||||
if (win != window)
|
||||
lastBrowser = false;
|
||||
}
|
||||
|
||||
if (lastBrowser) {
|
||||
// Let everyone know we are closing the last browser window
|
||||
let closingCanceled = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(closingCanceled, "browser-lastwindow-close-requested", null);
|
||||
if (closingCanceled.data)
|
||||
return;
|
||||
|
||||
Services.obs.notifyObservers(null, "browser-lastwindow-close-granted", null);
|
||||
}
|
||||
|
||||
window.QueryInterface(Ci.nsIDOMChromeWindow).minimize();
|
||||
window.close();
|
||||
},
|
||||
|
||||
saveAsPDF: function saveAsPDF(aBrowser) {
|
||||
|
Loading…
Reference in New Issue
Block a user