Updated to reflect recent modifications
git-svn-id: svn://10.0.0.236/trunk@11865 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -4,10 +4,12 @@
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID);
|
||||
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||
|
||||
|
||||
CWebShellContainer::CWebShellContainer()
|
||||
CWebShellContainer::CWebShellContainer(CMozillaBrowser *pOwner)
|
||||
{
|
||||
m_pOwner = pOwner;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +17,10 @@ CWebShellContainer::~CWebShellContainer()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsISupports implementation
|
||||
|
||||
NS_IMPL_ADDREF(CWebShellContainer)
|
||||
NS_IMPL_RELEASE(CWebShellContainer)
|
||||
|
||||
@@ -31,13 +37,13 @@ nsresult CWebShellContainer::QueryInterface(const nsIID& aIID, void** aInstanceP
|
||||
*aInstancePtrResult = (void*) ((nsIBrowserWindow*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
} */
|
||||
if (aIID.Equals(kIStreamObserverIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsIStreamObserver*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
*/
|
||||
|
||||
if (aIID.Equals(kIWebShellContainerIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsIWebShellContainer*)this);
|
||||
AddRef();
|
||||
@@ -57,47 +63,63 @@ nsresult CWebShellContainer::QueryInterface(const nsIID& aIID, void** aInstanceP
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIWebShellContainer implementation
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason)
|
||||
{
|
||||
// if (mStatus) {
|
||||
// nsAutoString url("Connecting to ");
|
||||
// url.Append(aURL);
|
||||
// mStatus->SetText(url);
|
||||
// }
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL)
|
||||
{
|
||||
// if (mThrobber) {
|
||||
// mThrobber->Start();
|
||||
// mLocation->SetText(aURL);
|
||||
// }
|
||||
USES_CONVERSION;
|
||||
OLECHAR *pszURL = W2OLE((WCHAR *)aURL);
|
||||
BSTR bstrURL = SysAllocString(pszURL);
|
||||
BSTR bstrTargetFrameName = NULL;
|
||||
BSTR bstrHeaders = NULL;
|
||||
VARIANT *pvPostData = NULL;
|
||||
VARIANT_BOOL bCancel = VARIANT_FALSE;
|
||||
long lFlags = 0;
|
||||
|
||||
m_pOwner->Fire_BeforeNavigate(bstrURL, lFlags, bstrTargetFrameName, pvPostData, bstrHeaders, &bCancel);
|
||||
if (bCancel == VARIANT_TRUE)
|
||||
{
|
||||
// TODO cancel browsing somehow
|
||||
}
|
||||
|
||||
SysFreeString(bstrURL);
|
||||
SysFreeString(bstrTargetFrameName);
|
||||
SysFreeString(bstrHeaders);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax)
|
||||
{
|
||||
m_pOwner->Fire_ProgressChange(aProgress, aProgressMax);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus)
|
||||
{
|
||||
// if (mThrobber) {
|
||||
// mThrobber->Stop();
|
||||
// }
|
||||
USES_CONVERSION;
|
||||
OLECHAR *pszURL = W2OLE((WCHAR *) aURL);
|
||||
BSTR bstrURL = SysAllocString(pszURL);
|
||||
m_pOwner->Fire_NavigateComplete(bstrURL);
|
||||
SysFreeString(bstrURL);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::NewWebShell(nsIWebShell *&aNewWebShell)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
nsresult rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -106,3 +128,32 @@ CWebShellContainer::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& a
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIStreamObserver implementation
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::OnStartBinding(nsIURL* aURL, const char *aContentType)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::OnProgress(nsIURL* aURL, PRInt32 aProgress, PRInt32 aProgressMax)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::OnStatus(nsIURL* aURL, const nsString &aMsg)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::OnStopBinding(nsIURL* aURL, PRInt32 aStatus, const nsString &aMsg)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user