home *** CD-ROM | disk | FTP | other *** search
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- const CONDUIT_TOOLBAR_COMPONENT_ID = Components.ID("{31c7d459-9cc3-44f2-9dca-fc11795309b4}");
-
- function loadJSFile(strFileName, bIsFromLibrary)
- {
- var oFile;
- if(bIsFromLibrary)
- {
- oFile = __LOCATION__.clone().parent.parent;
- oFile.append("lib");
- oFile.append(strFileName);
- }
- else
- {
- oFile = __LOCATION__.clone().parent;
- oFile.append(strFileName);
- }
-
- var oFilePath = Cc["@mozilla.org/network/protocol;1?name=file"].getService(Ci.nsIFileProtocolHandler).getURLSpecFromFile(oFile);
- Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader).loadSubScript(oFilePath);
- }
-
- loadJSFile("xpcom.js", true);
-
- //main component
- function ConduitToolbar() {
- this.wrappedJSObject = this;
- this.chat = ChatXPCOM;
- this.truste = TrusteXPCOM;
- this.toolbarDataParsing = ToolbarDataParsingXPCOM;
- this.alert = AlertXPCOM;
- this.clientLog = ClientLogXPCOM;
- this.uninstallLog = UninstallLogXPCOM;
- this.toolbar = ToolbarManagerXPCOM;
- this.fix404 = Fix404XPCOM;
- this.keysStorage = KeysStorageXPCOM;
- this.defaults = DefaultsXPCOM;
- this.webProgress = WebProgressXPCOM;
- this.twitter = TwitterXPCOM;
- this.searchInNewTab = SearchInNewTabXPCOM;
- this.prefs = ToolbarPrefsConsts;
- this.toolbarFunctions = ToolbarFunctions;
- this.facebook = FacebookXPCOM;
-
- this.QueryInterface = function (uuid) {
- if (uuid.equals(Components.interfaces.nsIConduitToolbar_CT2384137) ||
- uuid.equals(Components.interfaces.nsISupports)) {
- return this;
- }
-
- Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
- return null;
- };
-
- this.test = function(strOriginalCTID, strCurrentCTID)
- {
- alert("CT2384137");
- };
- }
-
- var ConduitToolbarModule = {
- registerSelf: function (compMgr, fileSpec, location, type) {
- compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
- compMgr.registerFactoryLocation(CONDUIT_TOOLBAR_COMPONENT_ID,
- "Conduit toolbar object",
- "@conduit.com/toolbar;1=CT2384137",
- fileSpec,
- location,
- type);
- },
-
- unregisterSelf: function(aCompMgr, aLocation, aLoaderStr){
-
- },
-
- getClassObject: function (compMgr, cid, iid) {
- if (!cid.equals(CONDUIT_TOOLBAR_COMPONENT_ID))
- throw Components.results.NS_ERROR_NO_INTERFACE;
- if (!iid.equals(Components.interfaces.nsIFactory))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return ConduitToolbarFactory;
- },
-
- canUnload: function(compMgr) {
- return true;
- }
- };
-
- var ConduitToolbarFactory = {
- createInstance: function (outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- return new ConduitToolbar().QueryInterface(iid);
- }
- };
-
- function NSGetModule(compMgr, fileSpec) {
- return ConduitToolbarModule;
- }