diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 7422edb1ba3..5733972e5ce 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -499,7 +499,6 @@ nsWebShell::nsWebShell() mScrollPref = nsScrollPreference_kAuto; mScriptGlobal = nsnull; mScriptContext = nsnull; -// mURLListener = nsnull; InitFrameData(PR_TRUE); mIsFrame = PR_FALSE; mWebShellType = nsWebShellContent; @@ -524,7 +523,6 @@ nsWebShell::~nsWebShell() NS_IF_RELEASE(mContentViewer); NS_IF_RELEASE(mDeviceContext); NS_IF_RELEASE(mPrefs); -// NS_IF_RELEASE(mURLListener); NS_IF_RELEASE(mContainer); NS_IF_RELEASE(mObserver); NS_IF_RELEASE(mNetSupport); @@ -875,7 +873,6 @@ nsWebShell::Destroy() // Stop any URLs that are currently being loaded... Stop(); -// SetURLListener(nsnull); SetContainer(nsnull); SetObserver(nsnull); SetDocLoaderObserver(nsnull); @@ -1026,18 +1023,6 @@ nsWebShell::SetContentViewer(nsIContentViewer* aViewer) return NS_OK; } -#if 0 -NS_IMETHODIMP -nsWebShell::SetURLListener(nsIURLListener* aURLListener) -{ - NS_IF_RELEASE(mURLListener); - mURLListener = aURLListener; - NS_IF_ADDREF(aURLListener); - return NS_OK; -} - -#endif /* 0 */ - NS_IMETHODIMP nsWebShell::SetContainer(nsIWebShellContainer* aContainer) { @@ -1047,17 +1032,6 @@ nsWebShell::SetContainer(nsIWebShellContainer* aContainer) return NS_OK; } -#if 0 -NS_IMETHODIMP -nsWebShell::GetURLListener(nsIURLListener *& aResult) -{ - aResult = mURLListener; - NS_IF_ADDREF(mURLListener); - return NS_OK; -} -#endif /* 0 */ - - NS_IMETHODIMP nsWebShell::GetContainer(nsIWebShellContainer*& aResult) { @@ -1535,16 +1509,6 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec, } } -#if 0 - // Tell URL listener we are loading a new url. - if (nsnull != mURLListener) { - nsresult rv = mURLListener->BeginLoadURL(this, aUrlSpec); - if (NS_FAILED(rv)) { - return rv; - } - } -#endif /* 0 */ - /* WebShell was primarily passing the buck when it came to streamObserver. * So, pass on the observer which is already a streamObserver to DocLoder. * - Radha @@ -1614,16 +1578,6 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, } } -#if 0 - // Give URL listener right of refusal. - if (nsnull != mURLListener) { - rv = mURLListener->WillLoadURL(this, urlSpec, nsLoadURL); - if (NS_FAILED(rv)) { - return rv; - } - } -#endif /* 0 */ - nsString* url = new nsString(urlSpec); if (aModifyHistory) { // Discard part of history that is no longer reachable @@ -1731,16 +1685,6 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex) } } -#if 0 - // Give URL listener right of refusal - if (nsnull != mURLListener) { - rv = mURLListener->WillLoadURL(this, urlSpec, nsLoadHistory); - if (NS_FAILED(rv)) { - return rv; - } - } -#endif /* 0 */ - printf("Goto %d\n", aHistoryIndex); mHistoryIndex = aHistoryIndex; ShowHistory(); @@ -2436,74 +2380,6 @@ nsWebShell::OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus) return NS_OK; } - -#if 0 -NS_IMETHODIMP -nsWebShell::OnConnectionsComplete() -{ - nsIDocumentViewer* docViewer; - nsresult rv = NS_ERROR_FAILURE; - - if (nsnull != mScriptGlobal) { - if (nsnull != mContentViewer && - NS_OK == mContentViewer->QueryInterface(kIDocumentViewerIID, (void**)&docViewer)) { - nsIPresContext *presContext; - if (NS_OK == docViewer->GetPresContext(presContext)) { - nsEventStatus status = nsEventStatus_eIgnore; - nsMouseEvent event; - event.eventStructType = NS_EVENT; - event.message = NS_PAGE_LOAD; - rv = mScriptGlobal->HandleDOMEvent(*presContext, &event, nsnull, NS_EVENT_FLAG_INIT, status); - - NS_RELEASE(presContext); - } - NS_RELEASE(docViewer); - } - } - - /* - *Fire the EndLoadURL(...) notification... - */ - if (((nsnull != mURLListener) || (nsnull != mContainer)) && (nsnull != mContentViewer)) { - nsIDocument* document; - - rv = mContentViewer->QueryInterface(kIDocumentViewerIID, (void**)&docViewer); - if (NS_SUCCEEDED(rv)) { - rv = docViewer->GetDocument(document); - if (NS_SUCCEEDED(rv)) { - nsAutoString urlString; - nsIURL* url; - - url = document->GetDocumentURL(); - if (nsnull != url) { - const char* spec; - rv = url->GetSpec(&spec); - - /* XXX: The load status needs to be passed in... */ - if (NS_SUCCEEDED(rv)) { - urlString = spec; - if (nsnull != mContainer) { - rv = mContainer->EndLoadURL(this, urlString, /* XXX */ 0 ); - } - if (NS_SUCCEEDED(rv) && nsnull != mURLListener) { - rv = mURLListener->EndLoadURL(this, urlString, /* XXX */ 0 ); - } - } - NS_RELEASE(url); - } - NS_RELEASE(document); - } - NS_RELEASE(docViewer); - } - } - - return rv; - -} - -#endif /* 0 */ - - /* For use with redirect/refresh url api */ class refreshData : public nsITimerCallback { diff --git a/mozilla/webshell/public/MANIFEST b/mozilla/webshell/public/MANIFEST index c275097ae1f..904a255a376 100644 --- a/mozilla/webshell/public/MANIFEST +++ b/mozilla/webshell/public/MANIFEST @@ -15,4 +15,3 @@ nsIThrobber.h nsIWebShell.h nsIClipboardCommands.h nsweb.h -nsIURLListener.h diff --git a/mozilla/webshell/public/Makefile.in b/mozilla/webshell/public/Makefile.in index cecb9429d78..f22f37c1ddf 100644 --- a/mozilla/webshell/public/Makefile.in +++ b/mozilla/webshell/public/Makefile.in @@ -36,7 +36,6 @@ EXPORTS = \ nsIThrobber.h \ nsIWebShell.h \ nsIClipboardCommands.h \ - nsIURLListener.h \ nsweb.h \ nsIDocStreamLoaderFactory.h \ $(NULL) diff --git a/mozilla/webshell/public/makefile.win b/mozilla/webshell/public/makefile.win index e40dc3122cc..32a7efed6ac 100644 --- a/mozilla/webshell/public/makefile.win +++ b/mozilla/webshell/public/makefile.win @@ -34,7 +34,6 @@ EXPORTS = \ nsIThrobber.h \ nsIWebShell.h \ nsIClipboardCommands.h \ - nsIURLListener.h \ nsweb.h \ $(NULL) diff --git a/mozilla/webshell/public/nsIURLListener.h b/mozilla/webshell/public/nsIURLListener.h deleted file mode 100644 index 29ec4f97b09..00000000000 --- a/mozilla/webshell/public/nsIURLListener.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and limitations - * under the License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are Copyright (C) 1998 - * Netscape Communications Corporation. All Rights Reserved. - */ -#ifndef nsIURLListener_h___ -#define nsIURLListener_h___ - -#include "nsISupports.h" -#include "nsIWebShell.h" - -class nsIWebShell; - -// Interface ID for nsIURLListener -#define NS_IURL_LISTENER_IID \ -{0x8b42a211, 0xcdc1, 0x11d2, {0xbd, 0xbe, 0x0, 0x50, 0x4, 0xa, 0x9b, 0x44}} - - -class nsIURLListener : public nsISupports { -public: - - NS_IMETHOD WillLoadURL(nsIWebShell* aShell, - const PRUnichar* aURL, - nsLoadType aReason) = 0; - - NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, - const PRUnichar* aURL) = 0; - - // XXX not yet implemented; should we? - NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, - const PRUnichar* aURL, - PRInt32 aProgress, - PRInt32 aProgressMax) = 0; - - NS_IMETHOD EndLoadURL(nsIWebShell* aShell, - const PRUnichar* aURL, - PRInt32 aStatus) = 0; - -}; -// Return value from WillLoadURL -#define NS_WEB_SHELL_CANCEL_URL_LOAD 0xC0E70000 - - -#endif /* nsIURLListener_h___ */ diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 7422edb1ba3..5733972e5ce 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -499,7 +499,6 @@ nsWebShell::nsWebShell() mScrollPref = nsScrollPreference_kAuto; mScriptGlobal = nsnull; mScriptContext = nsnull; -// mURLListener = nsnull; InitFrameData(PR_TRUE); mIsFrame = PR_FALSE; mWebShellType = nsWebShellContent; @@ -524,7 +523,6 @@ nsWebShell::~nsWebShell() NS_IF_RELEASE(mContentViewer); NS_IF_RELEASE(mDeviceContext); NS_IF_RELEASE(mPrefs); -// NS_IF_RELEASE(mURLListener); NS_IF_RELEASE(mContainer); NS_IF_RELEASE(mObserver); NS_IF_RELEASE(mNetSupport); @@ -875,7 +873,6 @@ nsWebShell::Destroy() // Stop any URLs that are currently being loaded... Stop(); -// SetURLListener(nsnull); SetContainer(nsnull); SetObserver(nsnull); SetDocLoaderObserver(nsnull); @@ -1026,18 +1023,6 @@ nsWebShell::SetContentViewer(nsIContentViewer* aViewer) return NS_OK; } -#if 0 -NS_IMETHODIMP -nsWebShell::SetURLListener(nsIURLListener* aURLListener) -{ - NS_IF_RELEASE(mURLListener); - mURLListener = aURLListener; - NS_IF_ADDREF(aURLListener); - return NS_OK; -} - -#endif /* 0 */ - NS_IMETHODIMP nsWebShell::SetContainer(nsIWebShellContainer* aContainer) { @@ -1047,17 +1032,6 @@ nsWebShell::SetContainer(nsIWebShellContainer* aContainer) return NS_OK; } -#if 0 -NS_IMETHODIMP -nsWebShell::GetURLListener(nsIURLListener *& aResult) -{ - aResult = mURLListener; - NS_IF_ADDREF(mURLListener); - return NS_OK; -} -#endif /* 0 */ - - NS_IMETHODIMP nsWebShell::GetContainer(nsIWebShellContainer*& aResult) { @@ -1535,16 +1509,6 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec, } } -#if 0 - // Tell URL listener we are loading a new url. - if (nsnull != mURLListener) { - nsresult rv = mURLListener->BeginLoadURL(this, aUrlSpec); - if (NS_FAILED(rv)) { - return rv; - } - } -#endif /* 0 */ - /* WebShell was primarily passing the buck when it came to streamObserver. * So, pass on the observer which is already a streamObserver to DocLoder. * - Radha @@ -1614,16 +1578,6 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, } } -#if 0 - // Give URL listener right of refusal. - if (nsnull != mURLListener) { - rv = mURLListener->WillLoadURL(this, urlSpec, nsLoadURL); - if (NS_FAILED(rv)) { - return rv; - } - } -#endif /* 0 */ - nsString* url = new nsString(urlSpec); if (aModifyHistory) { // Discard part of history that is no longer reachable @@ -1731,16 +1685,6 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex) } } -#if 0 - // Give URL listener right of refusal - if (nsnull != mURLListener) { - rv = mURLListener->WillLoadURL(this, urlSpec, nsLoadHistory); - if (NS_FAILED(rv)) { - return rv; - } - } -#endif /* 0 */ - printf("Goto %d\n", aHistoryIndex); mHistoryIndex = aHistoryIndex; ShowHistory(); @@ -2436,74 +2380,6 @@ nsWebShell::OnEndURLLoad(nsIURL* aURL, PRInt32 aStatus) return NS_OK; } - -#if 0 -NS_IMETHODIMP -nsWebShell::OnConnectionsComplete() -{ - nsIDocumentViewer* docViewer; - nsresult rv = NS_ERROR_FAILURE; - - if (nsnull != mScriptGlobal) { - if (nsnull != mContentViewer && - NS_OK == mContentViewer->QueryInterface(kIDocumentViewerIID, (void**)&docViewer)) { - nsIPresContext *presContext; - if (NS_OK == docViewer->GetPresContext(presContext)) { - nsEventStatus status = nsEventStatus_eIgnore; - nsMouseEvent event; - event.eventStructType = NS_EVENT; - event.message = NS_PAGE_LOAD; - rv = mScriptGlobal->HandleDOMEvent(*presContext, &event, nsnull, NS_EVENT_FLAG_INIT, status); - - NS_RELEASE(presContext); - } - NS_RELEASE(docViewer); - } - } - - /* - *Fire the EndLoadURL(...) notification... - */ - if (((nsnull != mURLListener) || (nsnull != mContainer)) && (nsnull != mContentViewer)) { - nsIDocument* document; - - rv = mContentViewer->QueryInterface(kIDocumentViewerIID, (void**)&docViewer); - if (NS_SUCCEEDED(rv)) { - rv = docViewer->GetDocument(document); - if (NS_SUCCEEDED(rv)) { - nsAutoString urlString; - nsIURL* url; - - url = document->GetDocumentURL(); - if (nsnull != url) { - const char* spec; - rv = url->GetSpec(&spec); - - /* XXX: The load status needs to be passed in... */ - if (NS_SUCCEEDED(rv)) { - urlString = spec; - if (nsnull != mContainer) { - rv = mContainer->EndLoadURL(this, urlString, /* XXX */ 0 ); - } - if (NS_SUCCEEDED(rv) && nsnull != mURLListener) { - rv = mURLListener->EndLoadURL(this, urlString, /* XXX */ 0 ); - } - } - NS_RELEASE(url); - } - NS_RELEASE(document); - } - NS_RELEASE(docViewer); - } - } - - return rv; - -} - -#endif /* 0 */ - - /* For use with redirect/refresh url api */ class refreshData : public nsITimerCallback {