Close now simply calls destroy. nsWebShellWindow now has a subclass for Destroy which does everything that Close use to do. Removed all the implementation of nsIWebShellContainer methods that went away.
git-svn-id: svn://10.0.0.236/trunk@65629 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -362,23 +362,7 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
|
||||
NS_METHOD
|
||||
nsWebShellWindow::Close()
|
||||
{
|
||||
#ifdef USE_NATIVE_MENUS
|
||||
// unregister as document listener
|
||||
// this is needed for menus
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
if(mDocShell)
|
||||
mDocShell->GetContentViewer(getter_AddRefs(cv));
|
||||
nsCOMPtr<nsIDocumentViewer> docv(do_QueryInterface(cv));
|
||||
if(docv)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
docv->GetDocument(*getter_AddRefs(doc));
|
||||
if(doc)
|
||||
doc->RemoveObserver(NS_STATIC_CAST(nsIDocumentObserver*, this));
|
||||
}
|
||||
#endif
|
||||
|
||||
return nsXULWindow::Destroy();
|
||||
return Destroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -578,40 +562,6 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShellWindow::WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL,
|
||||
nsLoadType aReason)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShellWindow::BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL)
|
||||
{
|
||||
// If loading a new root .xul document, then redo chrome.
|
||||
if (aShell == mWebShell) {
|
||||
mChromeLoaded = PR_FALSE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShellWindow::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL,
|
||||
PRInt32 aProgress, PRInt32 aProgressMax)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShellWindow::EndLoadURL(nsIWebShell* aWebShell, const PRUnichar* aURL,
|
||||
nsresult aStatus)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------
|
||||
NS_IMETHODIMP nsWebShellWindow::CreateMenu(nsIMenuBar * aMenuBar,
|
||||
nsIDOMNode * aMenuNode,
|
||||
@@ -1755,6 +1705,28 @@ nsWebShellWindow::NotifyObservers( const nsString &aTopic, const nsString &someD
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
// nsIBaseWindow
|
||||
NS_IMETHODIMP nsWebShellWindow::Destroy()
|
||||
{
|
||||
#ifdef USE_NATIVE_MENUS
|
||||
// unregister as document listener
|
||||
// this is needed for menus
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
if(mDocShell)
|
||||
mDocShell->GetContentViewer(getter_AddRefs(cv));
|
||||
nsCOMPtr<nsIDocumentViewer> docv(do_QueryInterface(cv));
|
||||
if(docv)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
docv->GetDocument(*getter_AddRefs(doc));
|
||||
if(doc)
|
||||
doc->RemoveObserver(NS_STATIC_CAST(nsIDocumentObserver*, this));
|
||||
}
|
||||
#endif
|
||||
|
||||
return nsXULWindow::Destroy();
|
||||
}
|
||||
|
||||
// nsIPrompt
|
||||
NS_IMETHODIMP nsWebShellWindow::Alert(const PRUnichar *text)
|
||||
|
||||
Reference in New Issue
Block a user