Changed the FindNamedBrowser to be FindNamedBrowserItem. This is important because it's possible that a frame needs to be returned, not just a toplevel browser object. So we need to be able to return a destination frame from this call. So now the API talks in terms of a frame.

git-svn-id: svn://10.0.0.236/trunk@64349 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
tbogard%aol.net 2000-03-28 09:24:12 +00:00
parent fb183a84d6
commit 6b7b9e9d5f
2 changed files with 12 additions and 14 deletions

View File

@ -111,19 +111,8 @@ NS_IMETHODIMP nsDocShellTreeOwner::FindItemWithName(const PRUnichar* aName,
NS_ENSURE_TRUE(mWebBrowserChrome, NS_ERROR_FAILURE);
nsCOMPtr<nsIWebBrowser> foundWebBrowser;
NS_ENSURE_SUCCESS(mWebBrowserChrome->FindNamedBrowser(aName,
getter_AddRefs(foundWebBrowser)), NS_ERROR_FAILURE);
if(!foundWebBrowser)
return NS_OK;
nsCOMPtr<nsIDocShell> foundDocShell;
foundWebBrowser->GetDocShell(getter_AddRefs(foundDocShell));
nsCOMPtr<nsIDocShellTreeItem> foundDocShellAsItem;
*aFoundItem = foundDocShellAsItem;
NS_IF_ADDREF(*aFoundItem);
NS_ENSURE_SUCCESS(mWebBrowserChrome->FindNamedBrowserItem(aName, aFoundItem),
NS_ERROR_FAILURE);
return NS_OK;
}

View File

@ -23,6 +23,7 @@
#include "nsISupports.idl"
interface nsIWebBrowser;
interface nsIDocShellTreeItem;
/**
* The nsIWebBrowserChrome
@ -97,7 +98,15 @@ interface nsIWebBrowserChrome : nsISupports
*/
nsIWebBrowser getNewBrowser(in unsigned long chromeMask);
nsIWebBrowser findNamedBrowser(in wstring aName);
/*
Return the child DocShellTreeItem with the specified name. To implement this
an embedder should call nsIDocShellTreeItem::findItemWithName on all the open
webBrowser objects. If one succeeds this should be returned. If they all fail
simply return null.
@param aName - This is the name of the item that is trying to be found.
*/
nsIDocShellTreeItem findNamedBrowserItem(in wstring aName);
/*
Tells the chrome to size itself such that the browser will be the