diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index 5bc05647cea..82743ac53e4 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -240,6 +240,10 @@ public: NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); + NS_IMETHOD CanCreateNewWebShell(PRBool& aResult); + NS_IMETHOD SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken); @@ -1889,6 +1893,27 @@ nsWebShell::NewWebShell(PRUint32 aChromeMask, return NS_OK; } +NS_IMETHODIMP +nsWebShell::CanCreateNewWebShell(PRBool& aResult) +{ + aResult = PR_TRUE; + if (nsnull != mContainer) { + return mContainer->CanCreateNewWebShell(aResult); + } + return NS_OK; +} + +NS_IMETHODIMP +nsWebShell::SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell) +{ + if (nsnull != mContainer) { + return mContainer->SetNewWebShellInfo(aName, anURL, aOpenerShell, aChromeMask, aNewShell); + } + return NS_OK; +} + NS_IMETHODIMP nsWebShell::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) { diff --git a/webshell/public/nsIWebShell.h b/webshell/public/nsIWebShell.h index 11d22b5e058..730897f25a8 100644 --- a/webshell/public/nsIWebShell.h +++ b/webshell/public/nsIWebShell.h @@ -91,7 +91,15 @@ public: NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell) = 0; - + + // XXX dave sez: if kipp doesn't think NewWebShell should be part of + // this interface, then the next two methods probably shouldn't either. + // They should move to whereever NewWebShell moves. + NS_IMETHOD CanCreateNewWebShell(PRBool& aResult) = 0; + NS_IMETHOD SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell) = 0; + NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) = 0; diff --git a/webshell/src/nsWebShell.cpp b/webshell/src/nsWebShell.cpp index 5bc05647cea..82743ac53e4 100644 --- a/webshell/src/nsWebShell.cpp +++ b/webshell/src/nsWebShell.cpp @@ -240,6 +240,10 @@ public: NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); + NS_IMETHOD CanCreateNewWebShell(PRBool& aResult); + NS_IMETHOD SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken); @@ -1889,6 +1893,27 @@ nsWebShell::NewWebShell(PRUint32 aChromeMask, return NS_OK; } +NS_IMETHODIMP +nsWebShell::CanCreateNewWebShell(PRBool& aResult) +{ + aResult = PR_TRUE; + if (nsnull != mContainer) { + return mContainer->CanCreateNewWebShell(aResult); + } + return NS_OK; +} + +NS_IMETHODIMP +nsWebShell::SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell) +{ + if (nsnull != mContainer) { + return mContainer->SetNewWebShellInfo(aName, anURL, aOpenerShell, aChromeMask, aNewShell); + } + return NS_OK; +} + NS_IMETHODIMP nsWebShell::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) { diff --git a/webshell/tests/viewer/nsBrowserWindow.cpp b/webshell/tests/viewer/nsBrowserWindow.cpp index 1ff27ee6354..d4798bdb174 100644 --- a/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/webshell/tests/viewer/nsBrowserWindow.cpp @@ -1743,6 +1743,21 @@ nsBrowserWindow::NewWebShell(PRUint32 aChromeMask, return rv; } +NS_IMETHODIMP +nsBrowserWindow::CanCreateNewWebShell(PRBool& aResult) +{ + aResult = PR_TRUE; // We can always make a new web shell synchronously + return NS_OK; +} + +NS_IMETHODIMP +nsBrowserWindow::SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell) +{ + return NS_OK; // We don't care about this method, since we can make new web shells immediately. +} + NS_IMETHODIMP nsBrowserWindow::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) { diff --git a/webshell/tests/viewer/nsBrowserWindow.h b/webshell/tests/viewer/nsBrowserWindow.h index f4dd65e5648..1a579642b6f 100644 --- a/webshell/tests/viewer/nsBrowserWindow.h +++ b/webshell/tests/viewer/nsBrowserWindow.h @@ -106,6 +106,10 @@ public: NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); + NS_IMETHOD CanCreateNewWebShell(PRBool& aResult); + NS_IMETHOD SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken); diff --git a/webshell/tests/viewer/nsXPBaseWindow.cpp b/webshell/tests/viewer/nsXPBaseWindow.cpp index 721b86b1726..683928cb30e 100644 --- a/webshell/tests/viewer/nsXPBaseWindow.cpp +++ b/webshell/tests/viewer/nsXPBaseWindow.cpp @@ -561,6 +561,20 @@ NS_IMETHODIMP nsXPBaseWindow::NewWebShell(PRUint32 aChromeMask, return rv; } +NS_IMETHODIMP +nsXPBaseWindow::CanCreateNewWebShell(PRBool& aResult) +{ + aResult = PR_TRUE; // We can always make a new web shell synchronously + return NS_OK; +} + +NS_IMETHODIMP +nsXPBaseWindow::SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell) +{ + return NS_OK; // We don't care about this method, since we can make new web shells immediately. +} //---------------------------------------- diff --git a/webshell/tests/viewer/nsXPBaseWindow.h b/webshell/tests/viewer/nsXPBaseWindow.h index 06c6c61feb5..3e11ccd4244 100644 --- a/webshell/tests/viewer/nsXPBaseWindow.h +++ b/webshell/tests/viewer/nsXPBaseWindow.h @@ -97,6 +97,10 @@ public: NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); + NS_IMETHOD CanCreateNewWebShell(PRBool& aResult); + NS_IMETHOD SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 aChromeMask, + nsIWebShell** aNewShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken);