Bug 660785 - Respect startup prefs after closing in private browsing mode. [r=zpao]
authorJez Ng <jezreel@gmail.com>
Mon, 01 Aug 2011 16:14:19 -0700
changeset 74441 e9c579848ab6e09d1229d68fe0f60e00ed566d9c
parent 74440 d93bbef62f0b7a57e8cae609feecc1fb8f78c507
child 74442 d5c5b7841f212233c720ed67a6ce79824ae6e045
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszpao
bugs660785
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 660785 - Respect startup prefs after closing in private browsing mode. [r=zpao]
browser/components/sessionstore/src/nsSessionStore.js
--- a/browser/components/sessionstore/src/nsSessionStore.js
+++ b/browser/components/sessionstore/src/nsSessionStore.js
@@ -635,25 +635,26 @@ SessionStoreService.prototype = {
       case "enter":
         this._inPrivateBrowsing = true;
         break;
       case "exit":
         aSubject.QueryInterface(Ci.nsISupportsPRBool);
         let quitting = aSubject.data;
         if (quitting) {
           // save the backed up state with session set to stopped,
-          // otherwise resuming next time would look like a crash
+          // otherwise resuming next time would look like a crash.
+          // Whether we restore the session upon resume will be determined by the
+          // usual startup prefs, so we will have the same behavior regardless of
+          // whether the browser was closed while in normal or private browsing mode.
           if ("_stateBackup" in this) {
             var oState = this._stateBackup;
             oState.session = { state: STATE_STOPPED_STR };
 
             this._saveStateObject(oState);
           }
-          // make sure to restore the non-private session upon resuming
-          this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
         }
         else
           this._inPrivateBrowsing = false;
         delete this._stateBackup;
         break;
       }
 
       this._clearRestoringWindows();