How to add nsIWebBrowserChromeFocus to an embedded browser via javaxpcom

"[email protected]" <[email protected]> Tue, 4 Dec 2007 19:55:24 -0800 (PST)
Newsgroups gmane.comp.mozilla.devel.java
Organization http://groups.google.com
Message-ID <0064548e-49e0-4d4b-971c-455e435f2450__31330.7838667699$1196827249$gmane$org@x69g2000hsx.googlegroups.com>
I have embedded a browser in my Java application. Here is the code
snippet I used:

                        Mozilla mozilla = Mozilla.getInstance();

			nsIComponentManager componentManager = mozilla
					.getComponentManager();

			webBrowser = (nsIWebBrowser) componentManager
					.createInstanceByContractID(NS_WEBBROWSER_CONTRACTID, null,
							nsIWebBrowser.NS_IWEBBROWSER_IID);

			nsIBaseWindow baseWindow = (nsIBaseWindow) webBrowser
					.queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID);

			// Here is a native handle which will contains the browser window.
			int /* long */handle = widget.handle;

			baseWindow.initWindow(handle, 0, 0, 0, 1, 1);

			baseWindow.create();
			baseWindow.setVisibility(true);

The browser is working fine. Now I need to add a
nsIWebBrowserChromeFocus to this embedded browser so that the tab
navigation can work as expected between the Java UI and the browser.
The problem is I can't seem to find an API to set a
nsIWebBrowserChromeFocus implementation back to the native. This
interface isn't referenced d by any other interfaces in the XPCOM
document. Does anyone know how to achieve this? Thanks for your input.