michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * nsISessionStore keeps track of the current browsing state - i.e. michael@0: * tab history, cookies, scroll state, form data, and window features michael@0: * - and allows to restore everything into one window. michael@0: */ michael@0: michael@0: [scriptable, uuid(934697e4-3807-47f8-b6c9-6caa8d83ccd1)] michael@0: interface nsISessionStartup: nsISupports michael@0: { michael@0: /** michael@0: * Return a promise that is resolved once initialization michael@0: * is complete. michael@0: */ michael@0: readonly attribute jsval onceInitialized; michael@0: michael@0: // Get session state michael@0: readonly attribute jsval state; michael@0: michael@0: /** michael@0: * Determines whether there is a pending session restore. Should only be michael@0: * called after initialization has completed. michael@0: */ michael@0: boolean doRestore(); michael@0: michael@0: /** michael@0: * Determines whether automatic session restoration is enabled for this michael@0: * launch of the browser. This does not include crash restoration, and will michael@0: * return false if restoration will only be caused by a crash. michael@0: */ michael@0: boolean isAutomaticRestoreEnabled(); michael@0: michael@0: /** michael@0: * Returns whether we will restore a session that ends up replacing the michael@0: * homepage. The browser uses this to not start loading the homepage if michael@0: * we're going to stop its load anyway shortly after. michael@0: * michael@0: * This is meant to be an optimization for the average case that loading the michael@0: * session file finishes before we may want to start loading the default michael@0: * homepage. Should this be called before the session file has been read it michael@0: * will just return false. michael@0: */ michael@0: readonly attribute bool willOverrideHomepage; michael@0: michael@0: /** michael@0: * What type of session we're restoring. michael@0: * NO_SESSION There is no data available from the previous session michael@0: * RECOVER_SESSION The last session crashed. It will either be restored or michael@0: * about:sessionrestore will be shown. michael@0: * RESUME_SESSION The previous session should be restored at startup michael@0: * DEFER_SESSION The previous session is fine, but it shouldn't be restored michael@0: * without explicit action (with the exception of pinned tabs) michael@0: */ michael@0: const unsigned long NO_SESSION = 0; michael@0: const unsigned long RECOVER_SESSION = 1; michael@0: const unsigned long RESUME_SESSION = 2; michael@0: const unsigned long DEFER_SESSION = 3; michael@0: michael@0: readonly attribute unsigned long sessionType; michael@0: readonly attribute bool previousSessionCrashed; michael@0: };