зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
a606bb32e6
Коммит
84bafb9079
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче