mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-13 07:24:47 +00:00
bug 328159 - Wire up session data service, patch by Dietrich Ayala (dietrich@mozilla.com), r=me
This commit is contained in:
parent
775fac0194
commit
0919e5ec0b
@ -60,6 +60,7 @@ DIRS = \
|
||||
migration \
|
||||
preferences \
|
||||
search \
|
||||
sessionstore \
|
||||
shell \
|
||||
sidebar \
|
||||
$(NULL)
|
||||
|
@ -101,6 +101,21 @@ BrowserGlue.prototype = {
|
||||
ww.openWindow(null, "chrome://browser/content/safeMode.xul",
|
||||
"_blank", "chrome,centerscreen,modal,resizable=no", null);
|
||||
}
|
||||
else {
|
||||
// initialize the session-restore service
|
||||
var ssEnabled = true;
|
||||
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
try {
|
||||
ssEnabled = prefBranch.getBoolPref("browser.sessionstore.enabled");
|
||||
} catch (ex) {}
|
||||
|
||||
if (ssEnabled) {
|
||||
var ss = Components.classes["@mozilla.org/browser/sessionstore;1"].
|
||||
getService(Components.interfaces.nsISessionStore);
|
||||
ss.init();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// profile shutdown handler (contains profile cleanup routines)
|
||||
|
50
browser/components/sessionstore/Makefile.in
Normal file
50
browser/components/sessionstore/Makefile.in
Normal file
@ -0,0 +1,50 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Session-Restore code
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Dietrich Ayala <dietrich@mozilla.com>
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# 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
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = sessionstore
|
||||
XPIDL_MODULE = sessionstore
|
||||
|
||||
XPIDLSRCS = nsISessionStore.idl
|
||||
|
||||
DIRS = src
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
54
browser/components/sessionstore/nsISessionStore.idl
Normal file
54
browser/components/sessionstore/nsISessionStore.idl
Normal file
@ -0,0 +1,54 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Session Restore component.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Simon Bünzli <zeniko@gmail.com>
|
||||
*
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Dietrich Ayala <dietrich@mozilla.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
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
/**
|
||||
* nsISessionStore keeps track of the current browsing state - i.e.
|
||||
* tab history, cookies, scroll state, form data, POSTDATA and window features
|
||||
* - and allows to restore everything into one window.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(07fada1e-c3a6-11da-95a7-00e08161165f)]
|
||||
interface nsISessionStore : nsISupports
|
||||
{
|
||||
/**
|
||||
* Initialize the service
|
||||
*/
|
||||
void init();
|
||||
};
|
44
browser/components/sessionstore/src/Makefile.in
Normal file
44
browser/components/sessionstore/src/Makefile.in
Normal file
@ -0,0 +1,44 @@
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is the Session-Restore
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Dietrich Ayala <dietrich@mozilla.com>
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# 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
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXTRA_PP_COMPONENTS = nsSessionStore.js
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
2290
browser/components/sessionstore/src/nsSessionStore.js
Normal file
2290
browser/components/sessionstore/src/nsSessionStore.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@
|
||||
restoreTitle= %S - Session Restore
|
||||
restoreText=%S has recovered from a serious error. One of the pages you were viewing may have caused the problem, so you may experience further problems if you continue with the previous browsing session.
|
||||
buttonTitle=Restore Session
|
@ -21,6 +21,7 @@
|
||||
locale/browser/search.properties (%chrome/browser/search.properties)
|
||||
locale/browser/setDesktopBackground.dtd (%chrome/browser/setDesktopBackground.dtd)
|
||||
locale/browser/shellservice.properties (%chrome/browser/shellservice.properties)
|
||||
locale/browser/sessionstore.properties (%chrome/browser/sessionstore.properties)
|
||||
#ifdef MOZ_PLACES
|
||||
locale/browser/places/places.dtd (%chrome/browser/places/places.dtd)
|
||||
locale/browser/places/bookmarkProperties.dtd (%chrome/browser/places/bookmarkProperties.dtd)
|
||||
|
Loading…
x
Reference in New Issue
Block a user