Use SessionStore.jsm only.

This commit is contained in:
Tetsuharu OHZEKI 2013-11-06 22:46:25 +09:00
parent 5991114c47
commit 97637256a8
3 changed files with 9 additions and 27 deletions

View File

@ -32,8 +32,11 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const TAB_DROP_TYPE = 'application/x-moz-tabbrowser-tab';
Cu.import('resource:///modules/sessionstore/SessionStore.jsm');
var tabsDragUtils = {
revision : currentRevision,
@ -59,18 +62,7 @@
return data;
},
get TabRestoreStates() {
return this.SessionStoreNS.TabRestoreStates;
},
get SessionStoreNS() {
delete this.SessionStoreNS;
try {
// resource://app/modules/sessionstore/SessionStore.jsm ?
this.SessionStoreNS = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm', {});
}
catch(e) {
this.SessionStoreNS = {};
}
return this.SessionStoreNS;
return SessionStore.TabRestoreStates;
},
init : function TDU_init()

View File

@ -71,8 +71,8 @@ XPCOMUtils.defineLazyModuleGetter(this, 'Deferred',
XPCOMUtils.defineLazyModuleGetter(this, 'confirmWithPopup', 'resource://treestyletab-modules/lib/confirmWithPopup.js');
XPCOMUtils.defineLazyModuleGetter(this, 'utils', 'resource://treestyletab-modules/utils.js', 'TreeStyleTabUtils');
XPCOMUtils.defineLazyServiceGetter(this, 'SessionStore',
'@mozilla.org/browser/sessionstore;1', 'nsISessionStore');
XPCOMUtils.defineLazyModuleGetter(this, 'SessionStore',
'resource:///modules/sessionstore/SessionStore.jsm');
if (Services.appinfo.OS === 'WINNT') {
XPCOMUtils.defineLazyModuleGetter(this, 'AeroPeek',

View File

@ -59,6 +59,8 @@ XPCOMUtils.defineLazyGetter(this, 'stringBundle', function() {
XPCOMUtils.defineLazyModuleGetter(this, 'Task',
'resource://gre/modules/Task.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'SessionStore',
'resource:///modules/sessionstore/SessionStore.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'TreeStyleTabConstants',
'resource://treestyletab-modules/constants.js', 'TreeStyleTabConstants');
@ -262,19 +264,7 @@ let TreeStyleTabUtils = {
return browser.__SS_restoreState == 1;
},
get TabRestoreStates() {
return this.SessionStoreNS.TabRestoreStates;
},
get SessionStoreNS() {
if (!this._SessionStoreNS) {
try {
// resource://app/modules/sessionstore/SessionStore.jsm ?
this._SessionStoreNS = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm', {});
}
catch(e) {
this._SessionStoreNS = {};
}
}
return this._SessionStoreNS;
return SessionStore.TabRestoreStates;
},
getShortcutOrURI : function utils_getShortcutOrURI(aBrowserWindow, aURI)