Passing in nsIDocumentLoader as a parameter to all functions in nsIDocumentLoaderObserver...

This commit is contained in:
nisheeth%netscape.com 1999-04-28 06:47:40 +00:00
parent 75ce5062e7
commit 696fa5472d
10 changed files with 181 additions and 109 deletions

View File

@ -139,9 +139,6 @@ public:
const char* aCommand,
nsISupports* aExtraInfo);
NS_IMETHOD GetContentViewer(nsIContentViewer** aResult);
NS_IMETHOD HandleUnknownContentType( nsIURL* aURL,
const char *aContentType,
const char *aCommand );
// nsIWebShell
NS_IMETHOD Init(nsNativeWidget aNativeParent,
@ -266,14 +263,26 @@ public:
NS_IMETHOD ReleaseScriptContext(nsIScriptContext *aContext);
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIURL* aURL, const char* aContentType,
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
const char *aContentType,
const char *aCommand );
// NS_IMETHOD OnConnectionsComplete();
// nsIRefreshURL interface methods...
@ -747,11 +756,12 @@ nsWebShell::GetContentViewer(nsIContentViewer** aResult)
}
NS_IMETHODIMP
nsWebShell::HandleUnknownContentType( nsIURL* aURL,
const char *aContentType,
const char *aCommand ) {
nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
const char *aContentType,
const char *aCommand ) {
// If we have a doc loader observer, let it respond to this.
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( aURL, aContentType, aCommand )
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
: NS_ERROR_FAILURE;
}
@ -2231,7 +2241,9 @@ nsWebShell::ReleaseScriptContext(nsIScriptContext *aContext)
NS_IMETHODIMP
nsWebShell::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
const char* aCommand)
{
nsIDocumentViewer* docViewer;
nsresult rv = NS_ERROR_FAILURE;
@ -2258,7 +2270,7 @@ nsWebShell::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnStartDocumentLoad(aURL, aCommand);
mDocLoaderObserver->OnStartDocumentLoad(mDocLoader, aURL, aCommand);
}
@ -2268,7 +2280,9 @@ nsWebShell::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
NS_IMETHODIMP
nsWebShell::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRInt32 aStatus)
{
nsIDocumentViewer* docViewer;
nsresult rv = NS_ERROR_FAILURE;
@ -2309,7 +2323,7 @@ nsWebShell::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
*Fire the OnEndDocumentLoad of the DocLoaderobserver
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver) && (nsnull != aURL)){
mDocLoaderObserver->OnEndDocumentLoad(aURL, aStatus);
mDocLoaderObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus);
}
return rv;
@ -2317,7 +2331,9 @@ nsWebShell::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
}
NS_IMETHODIMP
nsWebShell::OnStartURLLoad(nsIURL* aURL, const char* aContentType,
nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
const char* aContentType,
nsIContentViewer* aViewer)
{
@ -2332,13 +2348,15 @@ nsWebShell::OnStartURLLoad(nsIURL* aURL, const char* aContentType,
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnStartURLLoad(aURL, aContentType, aViewer);
mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer);
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRUint32 aProgress,
PRUint32 aProgressMax)
{
/*
@ -2346,35 +2364,39 @@ nsWebShell::OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnProgressURLLoad(aURL, aProgress, aProgressMax);
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax);
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::OnStatusURLLoad(nsIURL* aURL, nsString& aMsg)
nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsString& aMsg)
{
/*
*Fire the OnStartDocumentLoad of the webshell observer and container...
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnStatusURLLoad(aURL, aMsg);
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg);
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus)
nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRInt32 aStatus)
{
/*
*Fire the OnStartDocumentLoad of the webshell observer
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnEndURLLoad(aURL, aStatus);
mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus);
}
return NS_OK;

View File

@ -1395,7 +1395,7 @@ void nsDocLoaderImpl::FireOnStartDocumentLoad(nsIURL* aURL,
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnStartDocumentLoad(aURL, aCommand);
observer->OnStartDocumentLoad((nsIDocumentLoader*) this, aURL, aCommand);
}
/*
@ -1416,7 +1416,7 @@ void nsDocLoaderImpl::FireOnEndDocumentLoad(PRInt32 aStatus)
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnEndDocumentLoad(mDocumentUrl, aStatus);
observer->OnEndDocumentLoad((nsIDocumentLoader*) this, mDocumentUrl, aStatus);
}
/*
@ -1438,7 +1438,7 @@ void nsDocLoaderImpl::FireOnStartURLLoad(nsIURL* aURL, const char* aContentType,
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnStartURLLoad(aURL, aContentType, aViewer);
observer->OnStartURLLoad((nsIDocumentLoader*) this, aURL, aContentType, aViewer);
}
/*
@ -1460,7 +1460,7 @@ void nsDocLoaderImpl::FireOnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnProgressURLLoad(aURL, aProgress, aProgressMax);
observer->OnProgressURLLoad((nsIDocumentLoader*) this, aURL, aProgress, aProgressMax);
}
/*
@ -1481,7 +1481,7 @@ void nsDocLoaderImpl::FireOnStatusURLLoad(nsIURL* aURL, nsString& aMsg)
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnStatusURLLoad(aURL, aMsg);
observer->OnStatusURLLoad((nsIDocumentLoader*) this, aURL, aMsg);
}
/*
@ -1502,7 +1502,7 @@ void nsDocLoaderImpl::FireOnEndURLLoad(nsIURL* aURL, PRInt32 aStatus)
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnEndURLLoad(aURL, aStatus);
observer->OnEndURLLoad((nsIDocumentLoader*) this, aURL, aStatus);
}
/*
@ -2016,7 +2016,7 @@ NS_METHOD nsDocumentBindInfo::OnStartBinding(nsIURL* aURL, const char *aContentT
printf("DocLoaderFactory: Unable to create ContentViewer for content-type: %s\n", aContentType);
if ( m_Container ) {
// Give content container a chance to do something with this URL.
rv = m_Container->HandleUnknownContentType( aURL, aContentType, m_Command );
rv = m_Container->HandleUnknownContentType( (nsIDocumentLoader*) m_DocLoader, aURL, aContentType, m_Command );
}
// Stop the binding.
// This crashes on Unix/Mac... Stop();

View File

@ -25,6 +25,7 @@
class nsIContentViewer;
class nsIURL;
class nsIDocumentLoader;
#define NS_ICONTENT_VIEWER_CONTAINER_IID \
{ 0xa6cf9055, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -46,9 +47,10 @@ public:
NS_IMETHOD GetContentViewer(nsIContentViewer** aResult) = 0;
NS_IMETHOD HandleUnknownContentType( nsIURL* aURL,
const char *aContentType,
const char *aCommand ) = 0;
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* aLoader,
nsIURL* aURL,
const char *aContentType,
const char *aCommand ) = 0;
};
#endif /* nsIContentViewerContainer_h___ */

View File

@ -24,6 +24,7 @@
// Forward declarations...
class nsIURL;
class nsIContentViewer;
class nsIDocumentLoader;
/* f6b4f550-317c-11d2-bd8c-00805f8ae3f4 */
@ -44,12 +45,12 @@ public:
* This notification occurs before any DNS resolution occurs, or
* a connection is established with the server...
*/
NS_IMETHOD OnStartDocumentLoad(nsIURL* aURL, const char* aCommand) = 0;
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aCommand) = 0;
/**
* Notify the observer that a document has been completely loaded.
*/
NS_IMETHOD OnEndDocumentLoad(nsIURL *aUrl, PRInt32 aStatus) = 0;
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt32 aStatus) = 0;
/**
* Notify the observer that the specified nsIURL has just started to load.
@ -57,32 +58,34 @@ public:
* This notification occurs after DNS resolution, and a connection to the
* server has been established.
*/
NS_IMETHOD OnStartURLLoad(nsIURL* aURL, const char* aContentType,
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer) = 0;
/**
* Notify the observer that progress has occurred in the loading of the
* specified URL...
*/
NS_IMETHOD OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
PRUint32 aProgressMax) = 0;
/**
* Notify the observer that status text is available regarding the URL
* being loaded...
*/
NS_IMETHOD OnStatusURLLoad(nsIURL* aURL, nsString& aMsg) = 0;
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, nsString& aMsg) = 0;
/**
* Notify the observer that the specified nsIURL has finished loading.
*/
NS_IMETHOD OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus) = 0;
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, PRInt32 aStatus) = 0;
/**
* Notify the observer that some content of unknown type has been
* encountered...
*/
NS_IMETHOD HandleUnknownContentType( nsIURL *aURL,
NS_IMETHOD HandleUnknownContentType( nsIDocumentLoader* loader,
nsIURL *aURL,
const char *aContentType,
const char *aCommand ) = 0;
};

View File

@ -1395,7 +1395,7 @@ void nsDocLoaderImpl::FireOnStartDocumentLoad(nsIURL* aURL,
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnStartDocumentLoad(aURL, aCommand);
observer->OnStartDocumentLoad((nsIDocumentLoader*) this, aURL, aCommand);
}
/*
@ -1416,7 +1416,7 @@ void nsDocLoaderImpl::FireOnEndDocumentLoad(PRInt32 aStatus)
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnEndDocumentLoad(mDocumentUrl, aStatus);
observer->OnEndDocumentLoad((nsIDocumentLoader*) this, mDocumentUrl, aStatus);
}
/*
@ -1438,7 +1438,7 @@ void nsDocLoaderImpl::FireOnStartURLLoad(nsIURL* aURL, const char* aContentType,
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnStartURLLoad(aURL, aContentType, aViewer);
observer->OnStartURLLoad((nsIDocumentLoader*) this, aURL, aContentType, aViewer);
}
/*
@ -1460,7 +1460,7 @@ void nsDocLoaderImpl::FireOnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnProgressURLLoad(aURL, aProgress, aProgressMax);
observer->OnProgressURLLoad((nsIDocumentLoader*) this, aURL, aProgress, aProgressMax);
}
/*
@ -1481,7 +1481,7 @@ void nsDocLoaderImpl::FireOnStatusURLLoad(nsIURL* aURL, nsString& aMsg)
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnStatusURLLoad(aURL, aMsg);
observer->OnStatusURLLoad((nsIDocumentLoader*) this, aURL, aMsg);
}
/*
@ -1502,7 +1502,7 @@ void nsDocLoaderImpl::FireOnEndURLLoad(nsIURL* aURL, PRInt32 aStatus)
*/
for (index = 0; index < count; index++) {
nsIDocumentLoaderObserver* observer = (nsIDocumentLoaderObserver*)mDocObservers.ElementAt(index);
observer->OnEndURLLoad(aURL, aStatus);
observer->OnEndURLLoad((nsIDocumentLoader*) this, aURL, aStatus);
}
/*
@ -2016,7 +2016,7 @@ NS_METHOD nsDocumentBindInfo::OnStartBinding(nsIURL* aURL, const char *aContentT
printf("DocLoaderFactory: Unable to create ContentViewer for content-type: %s\n", aContentType);
if ( m_Container ) {
// Give content container a chance to do something with this URL.
rv = m_Container->HandleUnknownContentType( aURL, aContentType, m_Command );
rv = m_Container->HandleUnknownContentType( (nsIDocumentLoader*) m_DocLoader, aURL, aContentType, m_Command );
}
// Stop the binding.
// This crashes on Unix/Mac... Stop();

View File

@ -139,9 +139,6 @@ public:
const char* aCommand,
nsISupports* aExtraInfo);
NS_IMETHOD GetContentViewer(nsIContentViewer** aResult);
NS_IMETHOD HandleUnknownContentType( nsIURL* aURL,
const char *aContentType,
const char *aCommand );
// nsIWebShell
NS_IMETHOD Init(nsNativeWidget aNativeParent,
@ -266,14 +263,26 @@ public:
NS_IMETHOD ReleaseScriptContext(nsIScriptContext *aContext);
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIURL* aURL, const char* aContentType,
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
const char *aContentType,
const char *aCommand );
// NS_IMETHOD OnConnectionsComplete();
// nsIRefreshURL interface methods...
@ -747,11 +756,12 @@ nsWebShell::GetContentViewer(nsIContentViewer** aResult)
}
NS_IMETHODIMP
nsWebShell::HandleUnknownContentType( nsIURL* aURL,
const char *aContentType,
const char *aCommand ) {
nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
const char *aContentType,
const char *aCommand ) {
// If we have a doc loader observer, let it respond to this.
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( aURL, aContentType, aCommand )
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
: NS_ERROR_FAILURE;
}
@ -2231,7 +2241,9 @@ nsWebShell::ReleaseScriptContext(nsIScriptContext *aContext)
NS_IMETHODIMP
nsWebShell::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
const char* aCommand)
{
nsIDocumentViewer* docViewer;
nsresult rv = NS_ERROR_FAILURE;
@ -2258,7 +2270,7 @@ nsWebShell::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnStartDocumentLoad(aURL, aCommand);
mDocLoaderObserver->OnStartDocumentLoad(mDocLoader, aURL, aCommand);
}
@ -2268,7 +2280,9 @@ nsWebShell::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
NS_IMETHODIMP
nsWebShell::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRInt32 aStatus)
{
nsIDocumentViewer* docViewer;
nsresult rv = NS_ERROR_FAILURE;
@ -2309,7 +2323,7 @@ nsWebShell::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
*Fire the OnEndDocumentLoad of the DocLoaderobserver
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver) && (nsnull != aURL)){
mDocLoaderObserver->OnEndDocumentLoad(aURL, aStatus);
mDocLoaderObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus);
}
return rv;
@ -2317,7 +2331,9 @@ nsWebShell::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
}
NS_IMETHODIMP
nsWebShell::OnStartURLLoad(nsIURL* aURL, const char* aContentType,
nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
const char* aContentType,
nsIContentViewer* aViewer)
{
@ -2332,13 +2348,15 @@ nsWebShell::OnStartURLLoad(nsIURL* aURL, const char* aContentType,
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnStartURLLoad(aURL, aContentType, aViewer);
mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer);
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRUint32 aProgress,
PRUint32 aProgressMax)
{
/*
@ -2346,35 +2364,39 @@ nsWebShell::OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnProgressURLLoad(aURL, aProgress, aProgressMax);
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax);
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::OnStatusURLLoad(nsIURL* aURL, nsString& aMsg)
nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsString& aMsg)
{
/*
*Fire the OnStartDocumentLoad of the webshell observer and container...
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnStatusURLLoad(aURL, aMsg);
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg);
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus)
nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRInt32 aStatus)
{
/*
*Fire the OnStartDocumentLoad of the webshell observer
*/
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{
mDocLoaderObserver->OnEndURLLoad(aURL, aStatus);
mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus);
}
return NS_OK;

View File

@ -805,7 +805,7 @@ static nsresult setAttribute( nsIWebShell *shell,
// nsIDocumentLoaderObserver methods
NS_IMETHODIMP
nsBrowserAppCore::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aCommand)
{
// Kick start the throbber
setAttribute( mWebShell, "Browser:Throbber", "busy", "true" );
@ -814,7 +814,7 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
NS_IMETHODIMP
nsBrowserAppCore::OnEndDocumentLoad(nsIURL *aUrl, PRInt32 aStatus)
nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt32 aStatus)
{
const char* spec =nsnull;
@ -1312,9 +1312,10 @@ nsFileDownloadDialog::SetWindow( nsIWebShellWindow *aWindow ) {
}
NS_IMETHODIMP
nsBrowserAppCore::HandleUnknownContentType( nsIURL *aURL,
const char *aContentType,
const char *aCommand ) {
nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL *aURL,
const char *aContentType,
const char *aCommand ) {
nsresult rv = NS_OK;
// Note: The following code is broken. It should rightfully be loading
@ -1364,16 +1365,18 @@ nsBrowserAppCore::HandleUnknownContentType( nsIURL *aURL,
}
NS_IMETHODIMP
nsBrowserAppCore::OnStartURLLoad(nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer)
nsBrowserAppCore::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer)
{
return NS_OK;
}
NS_IMETHODIMP
nsBrowserAppCore::OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
nsBrowserAppCore::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
nsresult rv = NS_OK;
PRUint32 progress = aProgressMax ? ( aProgress * 100 ) / aProgressMax : 0;
@ -1385,7 +1388,8 @@ nsBrowserAppCore::OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
NS_IMETHODIMP
nsBrowserAppCore::OnStatusURLLoad(nsIURL* aURL, nsString& aMsg)
nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg)
{
nsresult rv = setAttribute( mWebShell, "Browser:Status", "text", aMsg );
return rv;
@ -1393,7 +1397,8 @@ nsBrowserAppCore::OnStatusURLLoad(nsIURL* aURL, nsString& aMsg)
NS_IMETHODIMP
nsBrowserAppCore::OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus)
nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus)
{
return NS_OK;

View File

@ -88,23 +88,24 @@ class nsBrowserAppCore : public nsBaseAppCore,
NS_IMETHOD LoadInitialPage();
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIURL *aUrl, PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIURL* aURL, const char* aContentType,
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL *aURL,
const char *aContentType,
const char *aCommand );
// nsINetSupport
NS_IMETHOD_(void) Alert(const nsString &aText);
NS_IMETHOD_(PRBool) Confirm(const nsString &aText);
NS_IMETHOD HandleUnknownContentType( nsIURL *aURL,
const char *aContentType,
const char *aCommand );
NS_IMETHOD_(PRBool) Prompt(const nsString &aText,

View File

@ -1087,13 +1087,15 @@ nsWebShellWindow::DestroyModalDialogEvent(PLEvent *aEvent)
// nsIDocumentLoaderObserver implementation
//----------------------------------------
NS_IMETHODIMP
nsWebShellWindow::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
nsWebShellWindow::OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aCommand)
{
return NS_OK;
}
NS_IMETHODIMP
nsWebShellWindow::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus)
{
#ifdef DEBUG_MENUSDEL
printf("OnEndDocumentLoad\n");
@ -1187,32 +1189,40 @@ nsWebShellWindow::OnEndDocumentLoad(nsIURL* aURL, PRInt32 aStatus)
}
NS_IMETHODIMP
nsWebShellWindow::OnStartURLLoad(nsIURL* aURL, const char* aContentType, nsIContentViewer* aViewer)
nsWebShellWindow::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
const char* aContentType,
nsIContentViewer* aViewer)
{
return NS_OK;
}
NS_IMETHODIMP
nsWebShellWindow::OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
nsWebShellWindow::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
PRUint32 aProgress,
PRUint32 aProgressMax)
{
return NS_OK;
}
NS_IMETHODIMP
nsWebShellWindow::OnStatusURLLoad(nsIURL* aURL, nsString& aMsg)
nsWebShellWindow::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg)
{
return NS_OK;
}
NS_IMETHODIMP
nsWebShellWindow::OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus)
nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus)
{
return NS_OK;
}
NS_IMETHODIMP
nsWebShellWindow::HandleUnknownContentType(nsIURL* aURL,
nsWebShellWindow::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
const char *aContentType,
const char *aCommand )
{

View File

@ -121,15 +121,22 @@ public:
nsIWidget* GetWidget(void) { return mWindow; }
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIURL *aUrl, PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIURL* aURL, PRUint32 aProgress,
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL *aUrl, PRInt32 aStatus);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIURL* aURL,
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
const char *aContentType,
const char *aCommand );