From 53822bc073dcd4208da4bcbe39908c0094a12eaf Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Mon, 19 Apr 1999 21:09:07 +0000 Subject: [PATCH] Changes to enable an asynchronous webshell instantiation in response to a window.open call. git-svn-id: svn://10.0.0.236/trunk@28077 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpfe/appshell/src/nsWebShellWindow.cpp | 31 ++++++++++++++----- mozilla/xpfe/appshell/src/nsWebShellWindow.h | 5 +++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 24110a44829..bb8489b9d6d 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -733,6 +733,25 @@ void nsWebShellWindow::LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWi NS_IMETHODIMP nsWebShellWindow::NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell) +{ + // Don't return a web shell, since the shell that will hold our content + // hasn't been instantiated yet. We'll have to wait and set up the linkage + // at a later date. + aNewWebShell = nsnull; + return NS_OK; +} + +NS_IMETHODIMP +nsWebShellWindow::CanCreateNewWebShell(PRBool& aResult) +{ + aResult = PR_FALSE; + return NS_OK; +} + +NS_IMETHODIMP +nsWebShellWindow::SetNewWebShellInfo(const nsString& aName, const nsString& anURL, + nsIWebShell* aOpenerShell, PRUint32 chrome, + nsIWebShell** aNewWebShellResult) { // Create a new browser window. That's what this method is here for. nsresult rv; @@ -757,14 +776,10 @@ nsWebShellWindow::NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsnull, nsnull, 615, 480); nsServiceManager::ReleaseService(kAppShellServiceCID, appShell); - if (aVisible) - newWindow->Show(PR_TRUE); - - // XXX Return our outermost webshell. We know this is wrong, since it means new windows - // won't have chrome, but it's going to take a little while for me to figure this out. - NS_IF_ADDREF(mWebShell); - aNewWebShell = mWebShell; - return rv; + // Now return our web shell. + NS_IF_ADDREF(mWebShell); + *aNewWebShellResult = mWebShell; + return NS_OK; } NS_IMETHODIMP nsWebShellWindow::FindWebShellWithName(const PRUnichar* aName, diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.h b/mozilla/xpfe/appshell/src/nsWebShellWindow.h index 4d8ad2f992f..7ec90a9047e 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.h +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.h @@ -87,6 +87,11 @@ public: 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);