mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 10:43:24 +00:00
teach GetInterface about nsIDOMWindow. bug 67369 r=hyatt,jst
This commit is contained in:
parent
e5f99d15c8
commit
dfec3854b8
@ -29,6 +29,7 @@
|
||||
#include "nsIURI.h"
|
||||
#include "nsIWebProgress.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "nsIChannel.h"
|
||||
@ -87,6 +88,14 @@ NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMETHODIMP WebBrowserChrome::GetInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aInstancePtr);
|
||||
|
||||
*aInstancePtr = 0;
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMWindow))) {
|
||||
if (mWebBrowser)
|
||||
return mWebBrowser->GetContentDOMWindow((nsIDOMWindow **) aInstancePtr);
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
return QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
@ -192,7 +201,6 @@ NS_IMETHODIMP WebBrowserChrome::CreateBrowserWindow(PRUint32 aChromeFlags,
|
||||
nsCOMPtr<nsIWebBrowserChrome> parent;
|
||||
nsCOMPtr<nsIWebBrowserChrome> newChrome;
|
||||
|
||||
parent = nsnull;
|
||||
if (aChromeFlags & nsIWebBrowserChrome::CHROME_DEPENDENT)
|
||||
parent = dont_QueryInterface(NS_STATIC_CAST(nsIWebBrowserChrome*, this));
|
||||
rv = ::CreateBrowserWindow(aChromeFlags, parent, getter_AddRefs(newChrome));
|
||||
|
Loading…
Reference in New Issue
Block a user