Bug 452975 - don't reset browser.sessionstore.resume_session_once until the first browser window opened. r=dietrich

This commit is contained in:
Simon Bünzli 2008-09-05 12:05:34 +02:00
Родитель a21f696299
Коммит e7bde32afc
2 изменённых файлов: 7 добавлений и 6 удалений

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

@ -135,10 +135,6 @@ SessionStartup.prototype = {
this._iniString = null; // reset the state string
}
if (this._prefBranch.getBoolPref("sessionstore.resume_session_once")) {
this._prefBranch.setBoolPref("sessionstore.resume_session_once", false);
}
if (this._sessionType != Ci.nsISessionStartup.NO_SESSION) {
// wait for the first browser window to open
var observerService = Cc["@mozilla.org/observer-service;1"].
@ -165,8 +161,7 @@ SessionStartup.prototype = {
this.init();
break;
case "quit-application":
// make sure that we don't init at this point, as that might
// unwantedly discard the session (cf. bug 409115)
// no reason for initializing at this point (cf. bug 409115)
observerService.removeObserver(this, "final-ui-startup");
observerService.removeObserver(this, "quit-application");
break;

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

@ -234,6 +234,12 @@ SessionStoreService.prototype = {
if (!this._resume_from_crash)
this._clearDisk();
// at this point, we've as good as resumed the session, so we can
// clear the resume_session_once flag, if it's set
if (this._loadState != STATE_QUITTING &&
this._prefBranch.getBoolPref("sessionstore.resume_session_once"))
this._prefBranch.setBoolPref("sessionstore.resume_session_once", false);
// As this is called at delayedStartup, restoration must be initiated here
this.onLoad(aWindow);
},