mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
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:
parent
b88a7a5752
commit
7c8653bac1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user