mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 14:30:43 +00:00
Updated to use nsIEmbeddingSiteWindow sr=blizzard@mozilla.org b=68581
This commit is contained in:
parent
d87865f317
commit
2e80d6b227
@ -62,7 +62,7 @@
|
||||
#include "nsIURL.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIWebBrowser.h"
|
||||
#include "nsIWebBrowserSiteWindow.h"
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
|
@ -57,7 +57,7 @@ NS_INTERFACE_MAP_BEGIN(CWebBrowserContainer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIURIContentListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeOwner)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserSiteWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIStreamObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDocumentLoaderObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
|
||||
@ -530,56 +530,22 @@ CWebBrowserContainer::GetPersistence(PRBool* aPersistPosition,
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIWebBrowserSiteWindow
|
||||
// nsIEmbeddingSiteWindow
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::Destroy(void)
|
||||
CWebBrowserContainer::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::SetPosition(PRInt32 x, PRInt32 y)
|
||||
CWebBrowserContainer::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::GetPosition(PRInt32 *x, PRInt32 *y)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::SetSize(PRInt32 cx, PRInt32 cy, PRBool fRepaint)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::GetSize(PRInt32 *cx, PRInt32 *cy)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, PRBool fRepaint)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::GetPositionAndSize(PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::GetSiteWindow(void **aParentNativeWindow)
|
||||
{
|
||||
@ -608,6 +574,19 @@ CWebBrowserContainer::SetTitle(const PRUnichar * aTitle)
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::GetVisibility(PRBool *aVisibility)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::SetVisibility(PRBool aVisibility)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIWebBrowserChrome implementation
|
||||
|
||||
@ -658,6 +637,13 @@ CWebBrowserContainer::CreateBrowserWindow(PRUint32 chromeFlags, PRInt32 aX, PRI
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::DestroyBrowserWindow(void)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebBrowserContainer::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include "nsIContextMenuListener.h"
|
||||
#include "nsICommandHandler.h"
|
||||
#include "nsIWebBrowserSiteWindow.h"
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
// interfaces into the web shell and so forth.
|
||||
|
||||
class CWebBrowserContainer :
|
||||
public nsIWebBrowserSiteWindow,
|
||||
public nsIEmbeddingSiteWindow,
|
||||
public nsIWebBrowserChrome,
|
||||
public nsIWebProgressListener,
|
||||
public nsIStreamObserver,
|
||||
@ -67,7 +67,7 @@ protected:
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBBROWSERSITEWINDOW
|
||||
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
||||
NS_DECL_NSIWEBBROWSERCHROME
|
||||
NS_DECL_NSIDOCSHELLTREEOWNER
|
||||
NS_DECL_NSIURICONTENTLISTENER
|
||||
|
@ -289,7 +289,7 @@ PRBool CBrowserFrame::BrowserFrameGlueObj::CreateNewBrowserFrame(PRUint32 chrome
|
||||
// the proper window size. If this window were to be visible then you'll see
|
||||
// the window size changes on the screen causing an unappealing flicker
|
||||
//
|
||||
// Changing the last param back to TRUE since the latest nsIWebBrowserSiteWindow
|
||||
// Changing the last param back to TRUE since the latest nsIEmbeddingSiteWindow
|
||||
// changes have gotten rid of the SetVisibility() method which we were using
|
||||
// to finally show the browser window. I think we need that functionality
|
||||
// back in
|
||||
|
@ -41,8 +41,8 @@
|
||||
// nsIWebBrowserChrome - This is a required interface to be implemented
|
||||
// by embeddors
|
||||
//
|
||||
// nsIWebBrowserSiteWindow - This is a required interface to be implemented
|
||||
// by embeddors
|
||||
// nsIEmbeddingSiteWindow - This is a required interface to be implemented
|
||||
// by embedders
|
||||
// - SetTitle() gets called after a document
|
||||
// load giving us the chance to update our
|
||||
// titlebar
|
||||
@ -104,7 +104,7 @@ NS_INTERFACE_MAP_BEGIN(CBrowserImpl)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserSiteWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPrompt)
|
||||
@ -224,6 +224,18 @@ NS_IMETHODIMP CBrowserImpl::CreateBrowserWindow(PRUint32 chromeMask, PRInt32 aX,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Will get called in response to JavaScript window.close()
|
||||
//
|
||||
NS_IMETHODIMP CBrowserImpl::DestroyBrowserWindow()
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
m_pBrowserFrameGlue->DestroyBrowserFrame();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Gets called in response to set the size of a window
|
||||
// Ex: In response to a JavaScript Window.Open() call of
|
||||
// the form
|
||||
@ -261,85 +273,53 @@ NS_IMETHODIMP CBrowserImpl::ExitModalEventLoop(nsresult aStatus)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// CBrowserImpl::nsIWebBrowserSiteWindow
|
||||
// CBrowserImpl::nsIEmbeddingSiteWindow
|
||||
//*****************************************************************************
|
||||
|
||||
// Will get called in response to JavaScript window.close()
|
||||
//
|
||||
NS_IMETHODIMP CBrowserImpl::Destroy()
|
||||
NS_IMETHODIMP CBrowserImpl::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
m_pBrowserFrameGlue->DestroyBrowserFrame();
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION &&
|
||||
(aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER ||
|
||||
aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER))
|
||||
{
|
||||
m_pBrowserFrameGlue->SetBrowserFramePositionAndSize(x, y, cx, cy, PR_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
|
||||
{
|
||||
m_pBrowserFrameGlue->SetBrowserFramePosition(x, y);
|
||||
}
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER ||
|
||||
aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
|
||||
{
|
||||
m_pBrowserFrameGlue->SetBrowserFrameSize(cx, cy);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::SetPosition(PRInt32 x, PRInt32 y)
|
||||
NS_IMETHODIMP CBrowserImpl::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
|
||||
{
|
||||
m_pBrowserFrameGlue->GetBrowserFramePosition(x, y);
|
||||
}
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER ||
|
||||
aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
|
||||
{
|
||||
m_pBrowserFrameGlue->GetBrowserFrameSize(cx, cy);
|
||||
}
|
||||
|
||||
m_pBrowserFrameGlue->SetBrowserFramePosition(x, y);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::GetPosition(PRInt32* x, PRInt32* y)
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
m_pBrowserFrameGlue->GetBrowserFramePosition(x, y);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Gets called when using JavaScript ResizeTo()/ResizeBy() methods
|
||||
//
|
||||
NS_IMETHODIMP CBrowserImpl::SetSize(PRInt32 cx, PRInt32 cy, PRBool fRepaint)
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
m_pBrowserFrameGlue->SetBrowserFrameSize(cx, cy);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Gets called when using JavaScript ResizeTo()/ResizeBy() methods
|
||||
//
|
||||
NS_IMETHODIMP CBrowserImpl::GetSize(PRInt32* cx, PRInt32* cy)
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
m_pBrowserFrameGlue->GetBrowserFrameSize(cx, cy);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, PRBool fRepaint)
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
m_pBrowserFrameGlue->SetBrowserFramePositionAndSize(x, y, cx, cy, fRepaint);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::GetPositionAndSize(PRInt32* x, PRInt32* y, PRInt32* cx, PRInt32* cy)
|
||||
{
|
||||
if(! m_pBrowserFrameGlue)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
m_pBrowserFrameGlue->GetBrowserFramePositionAndSize(x, y, cx, cy);
|
||||
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::GetSiteWindow(void** aSiteWindow)
|
||||
@ -376,3 +356,13 @@ NS_IMETHODIMP CBrowserImpl::SetTitle(const PRUnichar* aTitle)
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::GetVisibility(PRBool *aVisibility)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::SetVisibility(PRBool aVisibility)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
class CBrowserImpl : public nsIInterfaceRequestor,
|
||||
public nsIWebBrowserChrome,
|
||||
public nsIWebBrowserSiteWindow,
|
||||
public nsIEmbeddingSiteWindow,
|
||||
public nsIWebProgressListener,
|
||||
public nsIContextMenuListener,
|
||||
public nsIPrompt,
|
||||
@ -43,7 +43,7 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSIWEBBROWSERCHROME
|
||||
NS_DECL_NSIWEBBROWSERSITEWINDOW
|
||||
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
||||
NS_DECL_NSIWEBPROGRESSLISTENER
|
||||
NS_DECL_NSICONTEXTMENULISTENER
|
||||
NS_DECL_NSIPROMPT
|
||||
|
@ -27,7 +27,7 @@ an MFC Windows application
|
||||
Mainly demonstrates the use of the following interfaces:
|
||||
|
||||
nsIWebBrowserChrome
|
||||
nsIWebBrowserSiteWindow
|
||||
nsIEmbeddingSiteWindow
|
||||
nsIWebProgressListener
|
||||
nsIContextMenuListener
|
||||
nsIPrompt
|
||||
|
@ -80,7 +80,7 @@
|
||||
#include "nsError.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsIWebBrowserSiteWindow.h"
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
#include "nsIWebBrowserFind.h"
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
|
@ -75,7 +75,7 @@ NS_INTERFACE_MAP_BEGIN(WebBrowserChrome)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserSiteWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) // optional
|
||||
NS_INTERFACE_MAP_ENTRY(nsISHistoryListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
@ -210,6 +210,13 @@ NS_IMETHODIMP WebBrowserChrome::CreateBrowserWindow(PRUint32 aChromeFlags,
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP WebBrowserChrome::DestroyBrowserWindow(void)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP WebBrowserChrome::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
@ -413,50 +420,28 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, PRIn
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// WebBrowserChrome::nsIWebBrowserSiteWindow
|
||||
// WebBrowserChrome::nsIEmbeddingSiteWindow
|
||||
//*****************************************************************************
|
||||
|
||||
/* void destroy (); */
|
||||
NS_IMETHODIMP WebBrowserChrome::Destroy()
|
||||
NS_IMETHODIMP WebBrowserChrome::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
|
||||
{
|
||||
NS_ASSERTION(PR_FALSE, "You can't call this");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void setPosition (in long x, in long y); */
|
||||
NS_IMETHODIMP WebBrowserChrome::SetPosition(PRInt32 x, PRInt32 y)
|
||||
NS_IMETHODIMP WebBrowserChrome::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
|
||||
{
|
||||
return mBaseWindow->SetPosition(x, y);
|
||||
}
|
||||
|
||||
/* void getPosition (out long x, out long y); */
|
||||
NS_IMETHODIMP WebBrowserChrome::GetPosition(PRInt32 *x, PRInt32 *y)
|
||||
{
|
||||
return mBaseWindow->GetPosition(x, y);
|
||||
}
|
||||
|
||||
/* void setSize (in long cx, in long cy, in boolean fRepaint); */
|
||||
NS_IMETHODIMP WebBrowserChrome::SetSize(PRInt32 cx, PRInt32 cy, PRBool fRepaint)
|
||||
{
|
||||
return mBaseWindow->SetSize(cx, cy, fRepaint);
|
||||
}
|
||||
|
||||
/* void getSize (out long cx, out long cy); */
|
||||
NS_IMETHODIMP WebBrowserChrome::GetSize(PRInt32 *cx, PRInt32 *cy)
|
||||
{
|
||||
return mBaseWindow->GetSize(cx, cy);
|
||||
}
|
||||
|
||||
/* void setPositionAndSize (in long x, in long y, in long cx, in long cy, in boolean fRepaint); */
|
||||
NS_IMETHODIMP WebBrowserChrome::SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, PRBool fRepaint)
|
||||
{
|
||||
return mBaseWindow->SetPositionAndSize(x, y, cx, cy, fRepaint);
|
||||
}
|
||||
|
||||
/* void getPositionAndSize (out long x, out long y, out long cx, out long cy); */
|
||||
NS_IMETHODIMP WebBrowserChrome::GetPositionAndSize(PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
|
||||
{
|
||||
return mBaseWindow->GetPositionAndSize(x, y, cx, cy);
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
|
||||
{
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
}
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER ||
|
||||
aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
|
||||
{
|
||||
*cx = 0;
|
||||
*cy = 0;
|
||||
}
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void setFocus (); */
|
||||
@ -479,6 +464,17 @@ NS_IMETHODIMP WebBrowserChrome::SetTitle(const PRUnichar * aTitle)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* attribute boolean visibility; */
|
||||
NS_IMETHODIMP WebBrowserChrome::GetVisibility(PRBool * aVisibility)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aVisibility);
|
||||
*aVisibility = PR_TRUE;
|
||||
}
|
||||
NS_IMETHODIMP WebBrowserChrome::SetVisibility(PRBool aVisibility)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute nativeSiteWindow siteWindow */
|
||||
NS_IMETHODIMP WebBrowserChrome::GetSiteWindow(void * *aSiteWindow)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIContentViewerFile.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIWebBrowserSiteWindow.h"
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
@ -63,7 +63,7 @@ public:
|
||||
|
||||
class WebBrowserChrome : public nsIWebBrowserChrome,
|
||||
public nsIWebProgressListener,
|
||||
public nsIWebBrowserSiteWindow,
|
||||
public nsIEmbeddingSiteWindow,
|
||||
public nsIPrompt,
|
||||
public nsIInterfaceRequestor,
|
||||
public nsISHistoryListener,
|
||||
@ -78,7 +78,7 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBBROWSERCHROME
|
||||
NS_DECL_NSIWEBPROGRESSLISTENER
|
||||
NS_DECL_NSIWEBBROWSERSITEWINDOW
|
||||
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
||||
NS_DECL_NSIPROMPT
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSISHISTORYLISTENER
|
||||
|
@ -233,7 +233,7 @@ HWND GetBrowserFromChrome(nsIWebBrowserChrome *aChrome)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
nsCOMPtr<nsIWebBrowserSiteWindow> baseWindow = do_QueryInterface(aChrome);
|
||||
nsCOMPtr<nsIEmbeddingSiteWindow> baseWindow = do_QueryInterface(aChrome);
|
||||
HWND hwnd = NULL;
|
||||
baseWindow->GetSiteWindow((void **) & hwnd);
|
||||
return hwnd;
|
||||
@ -341,9 +341,9 @@ nsresult ResizeEmbedding(nsIWebBrowserChrome* chrome)
|
||||
if (!chrome)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIWebBrowserSiteWindow> baseWindow = do_QueryInterface(chrome);
|
||||
nsCOMPtr<nsIEmbeddingSiteWindow> embeddingSite = do_QueryInterface(chrome);
|
||||
HWND hWnd;
|
||||
baseWindow->GetSiteWindow((void **) & hWnd);
|
||||
embeddingSite->GetSiteWindow((void **) & hWnd);
|
||||
|
||||
if (!hWnd)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
@ -357,18 +357,17 @@ nsresult ResizeEmbedding(nsIWebBrowserChrome* chrome)
|
||||
rect.top += gDumbBannerSize;
|
||||
}
|
||||
|
||||
baseWindow->SetPositionAndSize(rect.left,
|
||||
// Make sure the browser is visible and sized
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
chrome->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
nsCOMPtr<nsIBaseWindow> webBrowserAsWin = do_QueryInterface(webBrowser);
|
||||
if (webBrowserAsWin)
|
||||
{
|
||||
webBrowserAsWin->SetPositionAndSize(rect.left,
|
||||
rect.top,
|
||||
rect.right - rect.left,
|
||||
rect.bottom - rect.top,
|
||||
PR_TRUE);
|
||||
|
||||
// Make sure the browser is visible
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
chrome->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
nsCOMPtr<nsIBaseWindow> webBrowserAsWin = do_QueryInterface(webBrowser);
|
||||
if (webBrowserAsWin)
|
||||
{
|
||||
webBrowserAsWin->SetVisibility(PR_TRUE);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user