зеркало из https://github.com/mozilla/pjs.git
Updated powerplant sample to use new nsIWebBrowserSiteWindow interface. b=46852, sr=blizzard@mozilla.org
This commit is contained in:
Родитель
6b8ef2d7f9
Коммит
8e2b3d9f9f
|
@ -111,7 +111,7 @@ NS_INTERFACE_MAP_BEGIN(CWebBrowserChrome)
|
|||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserSiteWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPrompt)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsITooltipListener)
|
||||
|
@ -363,24 +363,9 @@ CWebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress,
|
|||
|
||||
|
||||
//*****************************************************************************
|
||||
// CWebBrowserChrome::nsIBaseWindow
|
||||
// CWebBrowserChrome::nsIWebBrowserSiteWindow
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::InitWindow(nativeWindow aParentNativeWindow,
|
||||
nsIWidget* parentWidget, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
|
||||
{
|
||||
// Ignore wigdet parents for now. Don't think those are a vaild thing to call.
|
||||
NS_ENSURE_SUCCESS(SetPositionAndSize(x, y, cx, cy, PR_FALSE), NS_ERROR_FAILURE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::Create()
|
||||
{
|
||||
NS_ASSERTION(PR_FALSE, "You can't call this");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::Destroy()
|
||||
{
|
||||
delete mBrowserWindow;
|
||||
|
@ -458,32 +443,7 @@ NS_IMETHODIMP CWebBrowserChrome::GetPositionAndSize(PRInt32* x, PRInt32* y, PRIn
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::Repaint(PRBool aForce)
|
||||
{
|
||||
NS_ENSURE_TRUE(mBrowserWindow, NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
mBrowserWindow->Refresh();
|
||||
if (aForce)
|
||||
mBrowserWindow->UpdatePort();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::GetParentWidget(nsIWidget** aParentWidget)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParentWidget);
|
||||
//XXX First Check In
|
||||
NS_ASSERTION(PR_FALSE, "Not Yet Implemented");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::SetParentWidget(nsIWidget* aParentWidget)
|
||||
{
|
||||
NS_ASSERTION(PR_FALSE, "You can't call this");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::GetParentNativeWindow(nativeWindow* aParentNativeWindow)
|
||||
NS_IMETHODIMP CWebBrowserChrome::GetSiteWindow(void ** aParentNativeWindow)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParentNativeWindow);
|
||||
|
||||
|
@ -492,39 +452,6 @@ NS_IMETHODIMP CWebBrowserChrome::GetParentNativeWindow(nativeWindow* aParentNati
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::SetParentNativeWindow(nativeWindow aParentNativeWindow)
|
||||
{
|
||||
NS_ASSERTION(PR_FALSE, "You can't call this");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::GetVisibility(PRBool* aVisibility)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aVisibility);
|
||||
NS_ENSURE_TRUE(mBrowserWindow, NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
*aVisibility = mBrowserWindow->IsVisible();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::SetVisibility(PRBool aVisibility)
|
||||
{
|
||||
NS_ENSURE_TRUE(mBrowserWindow, NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
mBrowserWindow->SetVisibility(aVisibility);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::GetMainWidget(nsIWidget** aMainWidget)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aMainWidget);
|
||||
|
||||
//XXX First Check In
|
||||
NS_ASSERTION(PR_FALSE, "Not Yet Implemented");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::SetFocus()
|
||||
{
|
||||
//XXX First Check In
|
||||
|
@ -532,14 +459,6 @@ NS_IMETHODIMP CWebBrowserChrome::SetFocus()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::FocusAvailable(nsIBaseWindow* aCurrentFocus,
|
||||
PRBool* aTookFocus)
|
||||
{
|
||||
//XXX First Check In
|
||||
NS_ASSERTION(PR_FALSE, "Not Yet Implemented");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CWebBrowserChrome::GetTitle(PRUnichar** aTitle)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aTitle);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
// Interfaces Needed
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIWebBrowserSiteWindow.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIPrompt.h"
|
||||
|
@ -48,7 +48,7 @@ class CBrowserShell;
|
|||
|
||||
class CWebBrowserChrome : public nsIWebBrowserChrome,
|
||||
public nsIWebProgressListener,
|
||||
public nsIBaseWindow,
|
||||
public nsIWebBrowserSiteWindow,
|
||||
public nsIPrompt,
|
||||
public nsIInterfaceRequestor,
|
||||
public nsIContextMenuListener,
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBBROWSERCHROME
|
||||
NS_DECL_NSIWEBPROGRESSLISTENER
|
||||
NS_DECL_NSIBASEWINDOW
|
||||
NS_DECL_NSIWEBBROWSERSITEWINDOW
|
||||
NS_DECL_NSIPROMPT
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSICONTEXTMENULISTENER
|
||||
|
|
Загрузка…
Ссылка в новой задаче