More work on pyxpcom integration

This commit is contained in:
Marco Pesenti Gritti
2007-05-13 22:49:27 +02:00
parent 7e0fd77b13
commit 9e10d15c21
9 changed files with 106 additions and 29 deletions
@@ -6,7 +6,7 @@ const CID = Components.ID("{475e1194-92bc-4e03-92f3-5ad6ccddaca3}");
const CONTRACT_ID = "@laptop.org/browser/browserhelper;1";
const CLASS_NAME = "Browser Helper";
var browser;
var browsers = [];
function BrowserHelperService() {
}
@@ -16,14 +16,15 @@ BrowserHelperService.prototype = {
/* ........ nsIBrowserHelper API .............. */
getBrowser: function bh_getBrowser(aId) {
return browser;
return browsers[aId]
},
registerBrowser: function bh_registerBrowser(aBrowser, aId) {
browser = aBrowser;
registerBrowser: function bh_registerBrowser(aId, aBrowser) {
browsers[aId] = aBrowser;
},
unregisterBrowser: function bh_unregisterBrowser(aId) {
browsers.pop(aId)
},
QueryInterface: function(aIID) {
@@ -5,9 +5,9 @@ interface nsIWebBrowser;
[scriptable, uuid(475e1194-92bc-4e03-92f3-5ad6ccddaca3)]
interface nsIBrowserHelper : nsISupports
{
nsIWebBrowser getBrowser(in ACString id);
nsIWebBrowser getBrowser(in long id);
void registerBrowser(in ACString id, in nsIWebBrowser browser);
void registerBrowser(in long id, in nsIWebBrowser browser);
void unregisterBrowser(in ACString id);
void unregisterBrowser(in long id);
};