From f1add759faf36e4354087a11733af228c549ed67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Thu, 20 Jan 2011 13:43:32 -0800 Subject: [PATCH] Bug 592822 - Remove quit warning dialog [r=gavin, r=dietrich, a=blocking2.0:betaN+] --HG-- extra : rebase_source : 715b997b195f8127406324fca110582a6d15b4cb --- browser/app/profile/firefox.js | 4 +- .../sessionstore/src/nsSessionStore.js | 57 +++++++++---------- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index c02671d911ef..e552225b4a81 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -244,8 +244,8 @@ pref("browser.aboutHomeSnippets.updateUrl", "http://snippets.mozilla.com/%STARTP pref("browser.enable_automatic_image_resizing", true); pref("browser.chrome.site_icons", true); pref("browser.chrome.favicons", true); -pref("browser.warnOnQuit", true); -pref("browser.warnOnRestart", true); +pref("browser.warnOnQuit", false); +pref("browser.warnOnRestart", false); pref("browser.fullscreen.autohide", true); pref("browser.fullscreen.animateUp", 1); diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js index 0e96fb472537..87b8a332f1d2 100644 --- a/browser/components/sessionstore/src/nsSessionStore.js +++ b/browser/components/sessionstore/src/nsSessionStore.js @@ -769,41 +769,36 @@ SessionStoreService.prototype = { if (closedWindowState) { let newWindowState; -#ifndef XP_MACOSX - if (!this._doResumeSession()) { -#endif - // We want to split the window up into pinned tabs and unpinned tabs. - // Pinned tabs should be restored. If there are any remaining tabs, - // they should be added back to _closedWindows. - // We'll cheat a little bit and reuse _prepDataForDeferredRestore - // even though it wasn't built exactly for this. - let [appTabsState, normalTabsState] = - this._prepDataForDeferredRestore(JSON.stringify({ windows: [closedWindowState] })); +#ifdef XP_MACOSX + // We want to split the window up into pinned tabs and unpinned tabs. + // Pinned tabs should be restored. If there are any remaining tabs, + // they should be added back to _closedWindows. + // We'll cheat a little bit and reuse _prepDataForDeferredRestore + // even though it wasn't built exactly for this. + let [appTabsState, normalTabsState] = + this._prepDataForDeferredRestore(JSON.stringify({ windows: [closedWindowState] })); - // These are our pinned tabs, which we should restore - if (appTabsState.windows.length) { - newWindowState = appTabsState.windows[0]; - delete newWindowState.__lastSessionWindowID; - } - - // In case there were no unpinned tabs, remove the window from _closedWindows - if (!normalTabsState.windows.length) { - this._closedWindows.splice(closedWindowIndex, 1); - } - // Or update _closedWindows with the modified state - else { - delete normalTabsState.windows[0].__lastSessionWindowID; - this._closedWindows[closedWindowIndex] = normalTabsState.windows[0]; - } -#ifndef XP_MACOSX + // These are our pinned tabs, which we should restore + if (appTabsState.windows.length) { + newWindowState = appTabsState.windows[0]; + delete newWindowState.__lastSessionWindowID; } - else { - // If we're just restoring the window, make sure it gets removed from - // _closedWindows. + + // In case there were no unpinned tabs, remove the window from _closedWindows + if (!normalTabsState.windows.length) { this._closedWindows.splice(closedWindowIndex, 1); - newWindowState = closedWindowState; - delete newWindowState.hidden; } + // Or update _closedWindows with the modified state + else { + delete normalTabsState.windows[0].__lastSessionWindowID; + this._closedWindows[closedWindowIndex] = normalTabsState.windows[0]; + } +#else + // If we're just restoring the window, make sure it gets removed from + // _closedWindows. + this._closedWindows.splice(closedWindowIndex, 1); + newWindowState = closedWindowState; + delete newWindowState.hidden; #endif if (newWindowState) { // Ensure that the window state isn't hidden