mozilla = true;
public Browser(Composite parent, int style) { 	super(parent,style);		int[] result = new int[1];	if (BrowserCount == 0) {		try {			Library.loadLibrary ("swt-mozilla"); //$NON-NLS-1$		} catch (UnsatisfiedLinkError e) {			dispose();			SWT.error(SWT.ERROR_NO_HANDLES);		}				String mozillaPath = GRE.mozillaPath;		if (mozillaPath == null) {			dispose();			SWT.error(SWT.ERROR_NO_HANDLES);		}		LocProvider = new AppFileLocProvider();		LocProvider.AddRef();		int[] retVal = new int[1];		nsString path = new nsString(mozillaPath);		int rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, retVal);		path.dispose();		if (rc != XPCOM.NS_OK) error(rc);		if (retVal[0] == 0) error(XPCOM.NS_ERROR_NULL_POINTER);					nsILocalFile localFile = new nsILocalFile(retVal[0]);		rc = XPCOM.NS_InitEmbedding(localFile.getAddress(), LocProvider.getAddress());		localFile.Release();		if (rc != XPCOM.NS_OK) {			LocProvider.Release();			LocProvider = null;			dispose();			SWT.error(SWT.ERROR_NO_HANDLES);		}		rc = XPCOM.NS_GetComponentManager(result);		if (rc != XPCOM.NS_OK) error(rc);		if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);				nsIComponentManager componentManager = new nsIComponentManager(result[0]);		result[0] = 0;		rc = componentManager.CreateInstance(XPCOM.NS_APPSHELL_CID, 0, nsIAppShell.NS_IAPPSHELL_IID, result);		if (rc != XPCOM.NS_OK) error(rc);		if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);				componentManager.Release();				AppShell = new nsIAppShell(result[0]); 		rc = AppShell.Create(null, null);		if (rc != XPCOM.NS_OK) error(rc);		rc = AppShell.Spinup();		if (rc != XPCOM.NS_OK) error(rc);	}	BrowserCount++;	int rc = XPCOM.NS_GetComponentManager(result);	if (rc != XPCOM.NS_OK) error(rc);	if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);		nsIComponentManager componentManager = new nsIComponentManager(result[0]);	result[0] = 0;	nsID NS_IWEBBROWSER_CID = new nsID("F1EAC761-87E9-11d3-AF80-00A024FFC08C"); //$NON-NLS-1$	rc = componentManager.CreateInstance(NS_IWEBBROWSER_CID, 0, nsIWebBrowser.NS_IWEBBROWSER_IID, result);	if (rc != XPCOM.NS_OK) error(rc);	if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);		componentManager.Release();		webBrowser = new nsIWebBrowser(result[0]); 	createCOMInterfaces();	AddRef();	rc = webBrowser.SetContainerWindow(webBrowserChrome.getAddress());	if (rc != XPCOM.NS_OK) error(rc);				rc = webBrowser.QueryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID, result);	if (rc != XPCOM.NS_OK) error(rc);	if (result[0] == 0) error(XPCOM.NS_ERROR_NO_INTERFACE);		nsIBaseWindow baseWindow = new nsIBaseWindow(result[0]);		Rectangle rect = getClientArea();	if (rect.isEmpty()) {		rect.width = 1;		rect.height = 1;	}	rc = baseWindow.InitWindow(handle, 0, 0, 0, rect.width, rect.height);	if (rc != XPCOM.NS_OK) error(XPCOM.NS_ERROR_FAILURE);	rc = baseWindow.Create();	if (rc != XPCOM.NS_OK) error(XPCOM.NS_ERROR_FAILURE);	rc = baseWindow.SetVisibility(true);	if (rc != XPCOM.NS_OK) error(XPCOM.NS_ERROR_FAILURE);	baseWindow.Release();	rc = webBrowser.AddWebBrowserListener(weakReference.getAddress(), nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID);	if (rc != XPCOM.NS_OK) error(rc);	rc = webBrowser.SetParentURIContentListener(uriContentListener.getAddress());	if (rc != XPCOM.NS_OK) error(rc);	Listener listener = new Listener() {		public void handleEvent(Event event) {			switch (event.type) {				case SWT.Dispose: onDispose(); break;				case SWT.Resize: onResize(); break;				case SWT.FocusIn: onFocusGained(event);	break;				case SWT.FocusOut: onFocusLost(event); break;			}		}	};		int[] folderEvents = new int[]{		SWT.Dispose,		SWT.Resize,  		SWT.FocusIn, 		SWT.FocusOut, 	};	for (int i = 0; i < folderEvents.length; i++) {		addListener(folderEvents[i], listener);	}}