Bug 342020: Avoid default browser check if the user chose to restore a session after a crash, patch by Simon B�nzli <[email protected]>, r=mano

This commit is contained in:
[email protected] committed 2006-08-03 19:19:03 +00:00
1 parent 8eb2655d6a
commit 1374465055
2 files changed
+14 -3

No files matched your search

+9 -1
View File
@@ -39,6 +39,7 @@
# Joe Hughes <joe@retrovirus.com>
# Pamela Greene <pamg.bugs@gmail.com>
# Michael Ventnor <ventnors_dogs234@yahoo.com.au>
# Simon Bünzli <zeniko@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -1065,7 +1066,14 @@ function delayedStartup()
var shell = getShellService();
if (shell) {
var shouldCheck = shell.shouldCheckDefaultBrowser;
if (shouldCheck && !shell.isDefaultBrowser(true)) {
var willRestoreSession = false;
try {
var ss = Cc["@mozilla.org/browser/sessionstartup;1"].
getService(Ci.nsISessionStartup);
willRestoreSession = ss.doRestore();
}
catch (ex) { /* never mind; suppose SessionStore is broken */ }
if (shouldCheck && !shell.isDefaultBrowser(true) && !willRestoreSession) {
var brandBundle = document.getElementById("bundle_brand");
var shellBundle = document.getElementById("bundle_shell");
@@ -106,6 +106,9 @@ SessionStartup.prototype = {
// set default load state
_loadState: STATE_STOPPED,
// the state to restore at startup
_iniString: null,
/* ........ Global Event Handlers .............. */
/**
@@ -157,8 +160,8 @@ SessionStartup.prototype = {
// prompt and check prefs
this._doRestore = this._lastSessionCrashed ? this._doRecoverSession() : this._doResumeSession();
if (this._initialState && !this._doRestore) {
delete this._iniString; // delete state string
delete this._initialState; // delete state
this._iniString = null; // reset the state string
}
if (this._getPref("sessionstore.resume_session_once", DEFAULT_RESUME_SESSION_ONCE)) {
this._prefBranch.setBoolPref("sessionstore.resume_session_once", false);
@@ -235,7 +238,7 @@ SessionStartup.prototype = {
* @returns bool
*/
doRestore: function sss_doRestore() {
return this._doRestore;
return this._doRestore && this._iniString != null;
},
/* ........ Disk Access .............. */