GetInterface can now return an nsIDOMWindow (to its 'main content', or browser window, as expected for implementations of nsIWebBrowserChrome. bug 88229 r=jst,rpotts

This commit is contained in:
danm%netscape.com 2001-11-16 02:14:04 +00:00
parent b88a7a5752
commit 7c8653bac1

View File

@ -91,13 +91,16 @@ NS_INTERFACE_MAP_END
NS_IMETHODIMP nsWebBrowserChrome::GetInterface(const nsIID &aIID, void** aInstancePtr)
{
NS_ENSURE_ARG_POINTER(aInstancePtr);
*aInstancePtr = 0;
/* WindowCreator wants the main content shell when it asks a chrome window
for this interface. */
if (aIID.Equals(NS_GET_IID(nsIDOMWindow))) {
nsIDOMWindow *contentWin;
mBrowserWindow->mWebBrowser->GetContentDOMWindow(&contentWin);
*aInstancePtr = contentWin;
if (mBrowserWindow && mBrowserWindow->mWebBrowser) {
nsIDOMWindow *contentWin;
mBrowserWindow->mWebBrowser->GetContentDOMWindow(&contentWin);
*aInstancePtr = contentWin;
}
return NS_OK;
}
return QueryInterface(aIID, aInstancePtr);