Bug 515664 - when installing an addon, tabs should be restored on restart [r=mbrubeck]

This commit is contained in:
Mark Finkle 2010-12-30 21:43:08 -05:00
Родитель 82044fd4d7
Коммит 80d07abbf3
2 изменённых файлов: 11 добавлений и 0 удалений

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

@ -117,6 +117,7 @@ pref("browser.sessionhistory.max_total_viewers", 1);
pref("browser.sessionhistory.max_entries", 50);
/* session store */
pref("browser.sessionstore.resume_session_once", false);
pref("browser.sessionstore.resume_from_crash", true);
pref("browser.sessionstore.resume_from_crash_timeout", 60); // minutes
pref("browser.sessionstore.interval", 10000); // milliseconds

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

@ -111,6 +111,12 @@ SessionStore.prototype = {
// Disable crash recovery if it has been turned off
if (!Services.prefs.getBoolPref("browser.sessionstore.resume_from_crash"))
this._shouldRestore = false;
// Do we need to restore session just this once, in case of a restart?
if (Services.prefs.getBoolPref("browser.sessionstore.resume_session_once")) {
Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", false);
this._shouldRestore = true;
}
},
observe: function ss_observe(aSubject, aTopic, aData) {
@ -167,6 +173,10 @@ SessionStore.prototype = {
this._loadState = STATE_QUITTING;
break;
case "quit-application":
// If we are restarting, lets restore the tabs
if (aData == "restart")
Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true);
// Freeze the data at what we've got (ignoring closing windows)
this._loadState = STATE_QUITTING;