From 2c73987122e9e85d1c0c9835b5c2aa2761829247 Mon Sep 17 00:00:00 2001 From: "norris%netscape.com" Date: Mon, 25 Oct 1999 22:20:10 +0000 Subject: [PATCH] Expose referrer from web shell. r=travis needed for bug 11963. git-svn-id: svn://10.0.0.236/trunk@51753 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 7 +++++++ mozilla/webshell/public/nsIWebShell.h | 5 +++++ mozilla/webshell/src/nsWebShell.cpp | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index cf335ce593a..205db6987cd 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -199,6 +199,7 @@ public: NS_IMETHOD SetParent(nsIWebShell* aParent); NS_IMETHOD GetParent(nsIWebShell*& aParent); NS_IMETHOD GetParentEvenIfChrome(nsIWebShell*& aParent); + NS_IMETHOD GetReferrer(nsIURI **aReferrer); NS_IMETHOD GetChildCount(PRInt32& aResult); NS_IMETHOD AddChild(nsIWebShell* aChild); NS_IMETHOD RemoveChild(nsIWebShell* aChild); @@ -1576,6 +1577,12 @@ nsWebShell::GetParentEvenIfChrome(nsIWebShell*& aParent) return NS_OK; } +NS_IMETHODIMP +nsWebShell::GetReferrer(nsIURI **aReferrer) +{ + return NS_NewURI(aReferrer, mReferrer, nsnull); +} + NS_IMETHODIMP nsWebShell::GetChildCount(PRInt32& aResult) { diff --git a/mozilla/webshell/public/nsIWebShell.h b/mozilla/webshell/public/nsIWebShell.h index f38f1df3849..9ca0cf79f8c 100644 --- a/mozilla/webshell/public/nsIWebShell.h +++ b/mozilla/webshell/public/nsIWebShell.h @@ -260,6 +260,11 @@ public: */ NS_IMETHOD GetParentEvenIfChrome(nsIWebShell*& aParent) = 0; + /** + * Get the referrer of the link using this WebShell. + */ + NS_IMETHOD GetReferrer(nsIURI **aReferrer) = 0; + /** * Return the current number of WebShells which are immediate children * of the current WebShell. diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index cf335ce593a..205db6987cd 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -199,6 +199,7 @@ public: NS_IMETHOD SetParent(nsIWebShell* aParent); NS_IMETHOD GetParent(nsIWebShell*& aParent); NS_IMETHOD GetParentEvenIfChrome(nsIWebShell*& aParent); + NS_IMETHOD GetReferrer(nsIURI **aReferrer); NS_IMETHOD GetChildCount(PRInt32& aResult); NS_IMETHOD AddChild(nsIWebShell* aChild); NS_IMETHOD RemoveChild(nsIWebShell* aChild); @@ -1576,6 +1577,12 @@ nsWebShell::GetParentEvenIfChrome(nsIWebShell*& aParent) return NS_OK; } +NS_IMETHODIMP +nsWebShell::GetReferrer(nsIURI **aReferrer) +{ + return NS_NewURI(aReferrer, mReferrer, nsnull); +} + NS_IMETHODIMP nsWebShell::GetChildCount(PRInt32& aResult) {