1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/sessionstore/nsISessionStartup.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,66 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +/** 1.11 + * nsISessionStore keeps track of the current browsing state - i.e. 1.12 + * tab history, cookies, scroll state, form data, and window features 1.13 + * - and allows to restore everything into one window. 1.14 + */ 1.15 + 1.16 +[scriptable, uuid(934697e4-3807-47f8-b6c9-6caa8d83ccd1)] 1.17 +interface nsISessionStartup: nsISupports 1.18 +{ 1.19 + /** 1.20 + * Return a promise that is resolved once initialization 1.21 + * is complete. 1.22 + */ 1.23 + readonly attribute jsval onceInitialized; 1.24 + 1.25 + // Get session state 1.26 + readonly attribute jsval state; 1.27 + 1.28 + /** 1.29 + * Determines whether there is a pending session restore. Should only be 1.30 + * called after initialization has completed. 1.31 + */ 1.32 + boolean doRestore(); 1.33 + 1.34 + /** 1.35 + * Determines whether automatic session restoration is enabled for this 1.36 + * launch of the browser. This does not include crash restoration, and will 1.37 + * return false if restoration will only be caused by a crash. 1.38 + */ 1.39 + boolean isAutomaticRestoreEnabled(); 1.40 + 1.41 + /** 1.42 + * Returns whether we will restore a session that ends up replacing the 1.43 + * homepage. The browser uses this to not start loading the homepage if 1.44 + * we're going to stop its load anyway shortly after. 1.45 + * 1.46 + * This is meant to be an optimization for the average case that loading the 1.47 + * session file finishes before we may want to start loading the default 1.48 + * homepage. Should this be called before the session file has been read it 1.49 + * will just return false. 1.50 + */ 1.51 + readonly attribute bool willOverrideHomepage; 1.52 + 1.53 + /** 1.54 + * What type of session we're restoring. 1.55 + * NO_SESSION There is no data available from the previous session 1.56 + * RECOVER_SESSION The last session crashed. It will either be restored or 1.57 + * about:sessionrestore will be shown. 1.58 + * RESUME_SESSION The previous session should be restored at startup 1.59 + * DEFER_SESSION The previous session is fine, but it shouldn't be restored 1.60 + * without explicit action (with the exception of pinned tabs) 1.61 + */ 1.62 + const unsigned long NO_SESSION = 0; 1.63 + const unsigned long RECOVER_SESSION = 1; 1.64 + const unsigned long RESUME_SESSION = 2; 1.65 + const unsigned long DEFER_SESSION = 3; 1.66 + 1.67 + readonly attribute unsigned long sessionType; 1.68 + readonly attribute bool previousSessionCrashed; 1.69 +};