Merge pull request #334 from saneyuki/service

Use Service.jsm.
This commit is contained in:
SHIMODA "Piro" Hiroshi 2012-08-12 23:50:01 -07:00
commit d12b24195c
3 changed files with 16 additions and 16 deletions

View File

@ -1,10 +1,8 @@
const XULAppInfo = Components.classes['@mozilla.org/xre/app-info;1']
.getService(Components.interfaces.nsIXULAppInfo);
const comparator = Components.classes['@mozilla.org/xpcom/version-comparator;1']
.getService(Components.interfaces.nsIVersionComparator);
var Prefs = Components
.classes['@mozilla.org/preferences;1']
.getService(Components.interfaces.nsIPrefBranch);
Components.utils.import('resource://gre/modules/Services.jsm');
const XULAppInfo = Services.appinfo;
const comparator = Services.vc;
var Prefs = Services.prefs;
Components.utils.import('resource://treestyletab-modules/lib/animationManager.js', {});
Components.utils.import('resource://treestyletab-modules/lib/prefs.js', {});

View File

@ -40,14 +40,15 @@ const DEBUG = false;
const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import('resource://gre/modules/Services.jsm');
const TAB_DROP_TYPE = 'application/x-moz-tabbrowser-tab';
const SSS = Cc['@mozilla.org/content/style-sheet-service;1']
.getService(Ci.nsIStyleSheetService);
const SecMan = Cc['@mozilla.org/scriptsecuritymanager;1']
.getService(Ci.nsIScriptSecurityManager);
const IOService = Cc['@mozilla.org/network/io-service;1']
.getService(Ci.nsIIOService);
const IOService = Services.io;
function TabbarDNDObserver(aTabBrowser)
{

View File

@ -39,6 +39,7 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
Components.utils.import('resource://gre/modules/Services.jsm');
Components.utils.import('resource://treestyletab-modules/lib/prefs.js');
Components.utils.import('resource://treestyletab-modules/lib/namespace.jsm');
@ -276,7 +277,7 @@ var TreeStyleTabUtils = {
get ObserverService() {
if (!this._ObserverService) {
this._ObserverService = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService);
this._ObserverService = Services.obs;
}
return this._ObserverService;
},
@ -284,7 +285,7 @@ var TreeStyleTabUtils = {
get IOService() {
if (!this._IOService) {
this._IOService = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService);
this._IOService = Services.io;
}
return this._IOService;
},
@ -292,7 +293,7 @@ var TreeStyleTabUtils = {
get WindowMediator() {
if (!this._WindowMediator) {
this._WindowMediator = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator);
this._WindowMediator = Services.wm;
}
return this._WindowMediator;
},
@ -301,7 +302,7 @@ var TreeStyleTabUtils = {
get PromptService()
{
if (!this._PromptService) {
this._PromptService = Cc['@mozilla.org/embedcomp/prompt-service;1'].getService(Ci.nsIPromptService);
this._PromptService = Services.prompt;
}
return this._PromptService;
},
@ -318,14 +319,14 @@ var TreeStyleTabUtils = {
get XULAppInfo() {
if (!this._XULAppInfo) {
this._XULAppInfo = Cc['@mozilla.org/xre/app-info;1'].getService(Ci.nsIXULAppInfo).QueryInterface(Ci.nsIXULRuntime);
this._XULAppInfo = Services.appinfo;
}
return this._XULAppInfo;
},
_XULAppInfo : null,
get Comparator() {
if (!this._Comparator) {
this._Comparator = Cc['@mozilla.org/xpcom/version-comparator;1'].getService(Ci.nsIVersionComparator);
this._Comparator = Services.vc;
}
return this._Comparator;
},