From 14b69d6f60b3281fce47c2c6877c6b60963aa50f Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Fri, 11 Feb 2000 01:09:12 +0000 Subject: [PATCH] SetItemType now asserts when you try to set the type while there is a parent. FocusAvailable now supports calling up to the treeOwner. CreateTargetLocation() now has an implementation. r=hyatt --- docshell/base/nsDocShell.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index b7bd818af20b..933512832c1f 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -40,6 +40,7 @@ #include "nsXPIDLString.h" #include "nsIChromeEventHandler.h" #include "nsIDOMWindow.h" +#include "nsIWebBrowserChrome.h" #ifdef XXX_NS_DEBUG // XXX: we'll need a logging facility for debugging #define WEB_TRACE(_bit,_args) \ @@ -533,7 +534,10 @@ NS_IMETHODIMP nsDocShell::GetItemType(PRInt32* aItemType) NS_IMETHODIMP nsDocShell::SetItemType(PRInt32 aItemType) { NS_ENSURE_ARG((aItemType == typeChrome) || (typeContent == aItemType)); + NS_ENSURE_STATE(!mParent); + mItemType = aItemType; + return NS_OK; } @@ -1143,8 +1147,8 @@ NS_IMETHODIMP nsDocShell::FocusAvailable(nsIBaseWindow* aCurrentFocus, // docshell tree owner. nsCOMPtr nextCallWin(do_QueryInterface(mParent)); if(!nextCallWin) - {//XXX Enable this when docShellTreeOwner is added - //nextCallWin = do_QueryInterface(mDocShellTreeOwner); + { + nextCallWin = do_QueryInterface(mTreeOwner); } //If the current focus is us, offer it to the next owner. @@ -1721,9 +1725,7 @@ NS_IMETHODIMP nsDocShell::GetTarget(const PRUnichar* aName, nsIDocShellTreeItem* NS_IMETHODIMP nsDocShell::CreateTargetLocation(const PRUnichar* aName, nsIDocShellTreeItem** aShell) { - // XXX Implement - NS_ERROR("Not Yet IMplemented"); - return NS_ERROR_FAILURE; + return mTreeOwner->GetNewWindow(nsIWebBrowserChrome::allChrome, aShell); } void nsDocShell::SetCurrentURI(nsIURI* aUri)