Remove trunk instances of MOZILLA_1_8_BRANCH interfaces. Bug 347910, r+sr+a=jst

This commit is contained in:
bzbarsky@mit.edu 2007-10-05 16:37:25 -07:00
Родитель 44c38abbf4
Коммит cccfca082f
9 изменённых файлов: 83 добавлений и 145 удалений

Просмотреть файл

@ -247,10 +247,8 @@ nsFrameLoader::Destroy()
nsCOMPtr<nsIDocShellTreeItem> parentItem;
ourItem->GetParent(getter_AddRefs(parentItem));
nsCOMPtr<nsIDocShellTreeOwner> owner = do_GetInterface(parentItem);
nsCOMPtr<nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH> owner2 =
do_QueryInterface(owner);
if (owner2) {
owner2->ContentShellRemoved(ourItem);
if (owner) {
owner->ContentShellRemoved(ourItem);
}
}
}
@ -372,19 +370,14 @@ nsFrameLoader::EnsureDocShell()
// this some other way..... Not sure how yet.
nsCOMPtr<nsIDocShellTreeOwner> parentTreeOwner;
parentAsItem->GetTreeOwner(getter_AddRefs(parentTreeOwner));
nsCOMPtr<nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH> owner2 =
do_QueryInterface(parentTreeOwner);
PRBool is_primary = value.LowerCaseEqualsLiteral("content-primary");
if (owner2) {
if (parentTreeOwner) {
PRBool is_targetable = is_primary ||
value.LowerCaseEqualsLiteral("content-targetable");
owner2->ContentShellAdded2(docShellAsItem, is_primary, is_targetable,
value);
} else if (parentTreeOwner) {
parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary,
value.get());
is_targetable, value);
}
}

Просмотреть файл

@ -45,7 +45,7 @@
interface nsIDocShellTreeItem;
[scriptable, uuid(9e508466-5ebb-4618-abfa-9ad47bed0b2e)]
[scriptable, uuid(bc0eb30e-656e-491e-a7ae-7f460b660c8d)]
interface nsIDocShellTreeOwner : nsISupports
{
/*
@ -66,14 +66,31 @@ interface nsIDocShellTreeOwner : nsISupports
in nsIDocShellTreeItem aRequestor,
in nsIDocShellTreeItem aOriginalRequestor);
/*
Called when a content shell is added to the the docShell Tree.
aContentShell - the docShell that has been added.
aPrimary - true if this is the primary content shell
aID - the ID of the docShell that has been added.
*/
void contentShellAdded(in nsIDocShellTreeItem aContentShell,
in boolean aPrimary, in wstring aID);
/**
* Called when a content shell is added to the docshell tree. This is
* _only_ called for "root" content shells (that is, ones whose parent is a
* chrome shell).
*
* @param aContentShell the shell being added.
* @param aPrimary whether the shell is primary.
* @param aTargetable whether the shell can be a target for named window
* targeting.
* @param aID the "id" of the shell. What this actually means is
* undefined. Don't rely on this for anything.
*/
void contentShellAdded(in nsIDocShellTreeItem aContentShell,
in boolean aPrimary, in boolean aTargetable,
in AString aID);
/**
* Called when a content shell is removed from the docshell tree. This is
* _only_ called for "root" content shells (that is, ones whose parent is a
* chrome shell). Note that if aContentShell was never added,
* contentShellRemoved should just do nothing.
*
* @param aContentShell the shell being removed.
*/
void contentShellRemoved(in nsIDocShellTreeItem aContentShell);
/*
Returns the Primary Content Shell
@ -100,43 +117,3 @@ interface nsIDocShellTreeOwner : nsISupports
out boolean aPersistSize,
out boolean aPersistSizeMode);
};
/**
* Interface added to handle window targeting in tabbrowser. This is a total
* hack that's only needed to work around the fact that the tree owner api is
* really pretty useless for dealing with multiple "real" browsers in the same
* "docshell tree" and that there's no way to set up multiple treeowners in
* XUL-land right now. Gecko 1.9 will NOT be shipping this interface, and
* nsIDocShellTreeOwner will hopefully be improved significantly.
*
* @status TEMPORARY
*/
[scriptable, uuid(3c2a6927-e923-4ea8-bbda-a335c768ce4e)]
interface nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH : nsIDocShellTreeOwner
{
/**
* Called when a content shell is added to the docshell tree. This is _only_
* called for "root" content shells (that is, ones whose parent is a chrome
* shell).
*
* @param aContentShell the shell being added.
* @param aPrimary whether the shell is primary.
* @param aTargetable whether the shell can be a target for named window
* targeting.
* @param aID the "id" of the shell. What this actually means is undefined.
* Don't rely on this for anything.
*/
void contentShellAdded2(in nsIDocShellTreeItem aContentShell,
in boolean aPrimary, in boolean aTargetable,
in AString aID);
/**
* Called when a content shell is removed from the docshell tree. This is
* _only_ called for "root" content shells (that is, ones whose parent is a
* chrome shell). Note that if aContentShell was never added,
* contentShellRemoved should just do nothing.
*
* @param aContentShell the shell being removed.
*/
void contentShellRemoved(in nsIDocShellTreeItem aContentShell);
};

Просмотреть файл

@ -403,16 +403,30 @@ nsDocShellTreeOwner::RemoveFromWatcher()
NS_IMETHODIMP
nsDocShellTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, const PRUnichar* aID)
PRBool aPrimary, PRBool aTargetable,
const nsAString& aID)
{
if(mTreeOwner)
return mTreeOwner->ContentShellAdded(aContentShell, aPrimary, aID);
return mTreeOwner->ContentShellAdded(aContentShell, aPrimary,
aTargetable, aID);
if (aPrimary)
mPrimaryContentShell = aContentShell;
return NS_OK;
}
NS_IMETHODIMP
nsDocShellTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell)
{
if(mTreeOwner)
return mTreeOwner->ContentShellRemoved(aContentShell);
if(mPrimaryContentShell == aContentShell)
mPrimaryContentShell = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsDocShellTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell)
{

Просмотреть файл

@ -549,26 +549,16 @@ nsSubDocumentFrame::AttributeChanged(PRInt32 aNameSpaceID,
PRBool is_primary = value.LowerCaseEqualsLiteral("content-primary");
nsCOMPtr<nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH> owner2 =
do_QueryInterface(parentTreeOwner);
parentTreeOwner->ContentShellRemoved(docShellAsItem);
if (value.LowerCaseEqualsLiteral("content") ||
StringBeginsWith(value, NS_LITERAL_STRING("content-"),
nsCaseInsensitiveStringComparator())) {
PRBool is_targetable = is_primary ||
value.LowerCaseEqualsLiteral("content-targetable");
if (!owner2) {
// XXXbz this adds stuff even if it's not of type content-*, but not
// much we can do about that....
parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary,
value.get());
} else {
owner2->ContentShellRemoved(docShellAsItem);
if (value.LowerCaseEqualsLiteral("content") ||
StringBeginsWith(value, NS_LITERAL_STRING("content-"),
nsCaseInsensitiveStringComparator())) {
PRBool is_targetable = is_primary ||
value.LowerCaseEqualsLiteral("content-targetable");
owner2->ContentShellAdded2(docShellAsItem, is_primary, is_targetable,
value);
}
is_targetable, value);
}
}
}

Просмотреть файл

@ -130,7 +130,6 @@ NS_IMPL_RELEASE(nsChromeTreeOwner)
NS_INTERFACE_MAP_BEGIN(nsChromeTreeOwner)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocShellTreeOwner)
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeOwner)
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH)
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
@ -263,17 +262,21 @@ NS_IMETHODIMP nsChromeTreeOwner::FindItemWithName(const PRUnichar* aName,
return NS_OK;
}
NS_IMETHODIMP nsChromeTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, const PRUnichar* aID)
NS_IMETHODIMP
nsChromeTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, PRBool aTargetable,
const nsAString& aID)
{
NS_ENSURE_STATE(mXULWindow);
if (aID) {
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, PR_FALSE,
nsDependentString(aID));
}
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, aTargetable,
aID);
}
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, PR_FALSE,
EmptyString());
NS_IMETHODIMP
nsChromeTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell)
{
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellRemoved(aContentShell);
}
NS_IMETHODIMP nsChromeTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell)
@ -583,26 +586,6 @@ nsChromeTreeOwner::OnSecurityChange(nsIWebProgress *aWebProgress,
return NS_OK;
}
//*****************************************************************************
// nsChromeTreeOwner::nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH
//*****************************************************************************
NS_IMETHODIMP
nsChromeTreeOwner::ContentShellAdded2(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, PRBool aTargetable,
const nsAString& aID)
{
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, aTargetable,
aID);
}
NS_IMETHODIMP
nsChromeTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell)
{
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellRemoved(aContentShell);
}
//*****************************************************************************
// nsChromeTreeOwner: Helpers
//*****************************************************************************

Просмотреть файл

@ -53,7 +53,7 @@
class nsXULWindow;
class nsChromeTreeOwner : public nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH,
class nsChromeTreeOwner : public nsIDocShellTreeOwner,
public nsIBaseWindow,
public nsIInterfaceRequestor,
public nsIWebProgressListener,
@ -68,7 +68,6 @@ public:
NS_DECL_NSIBASEWINDOW
NS_DECL_NSIDOCSHELLTREEOWNER
NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSIDOCSHELLTREEOWNER_MOZILLA_1_8_BRANCH
static nsresult InitGlobals();
static void FreeGlobals();

Просмотреть файл

@ -118,7 +118,6 @@ NS_IMPL_RELEASE(nsContentTreeOwner)
NS_INTERFACE_MAP_BEGIN(nsContentTreeOwner)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocShellTreeOwner)
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeOwner)
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH)
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome2)
@ -303,17 +302,21 @@ NS_IMETHODIMP nsContentTreeOwner::FindItemWithName(const PRUnichar* aName,
return NS_OK;
}
NS_IMETHODIMP nsContentTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, const PRUnichar* aID)
NS_IMETHODIMP
nsContentTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, PRBool aTargetable,
const nsAString& aID)
{
NS_ENSURE_STATE(mXULWindow);
if (aID) {
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, PR_FALSE,
nsDependentString(aID));
}
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, aTargetable,
aID);
}
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, PR_FALSE,
EmptyString());
NS_IMETHODIMP
nsContentTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell)
{
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellRemoved(aContentShell);
}
NS_IMETHODIMP nsContentTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell)
@ -882,26 +885,6 @@ nsContentTreeOwner::ProvideWindow(nsIDOMWindow* aParent,
nsIBrowserDOMWindow::OPEN_NEW, aReturn);
}
//*****************************************************************************
// nsContentTreeOwner::nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH
//*****************************************************************************
NS_IMETHODIMP
nsContentTreeOwner::ContentShellAdded2(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, PRBool aTargetable,
const nsAString& aID)
{
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellAdded(aContentShell, aPrimary, aTargetable,
aID);
}
NS_IMETHODIMP
nsContentTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell)
{
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->ContentShellRemoved(aContentShell);
}
//*****************************************************************************
// nsContentTreeOwner: Accessors
//*****************************************************************************

Просмотреть файл

@ -55,7 +55,7 @@
class nsXULWindow;
class nsSiteWindow2;
class nsContentTreeOwner : public nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH,
class nsContentTreeOwner : public nsIDocShellTreeOwner,
public nsIBaseWindow,
public nsIInterfaceRequestor,
public nsIWebBrowserChrome2,
@ -73,7 +73,6 @@ public:
NS_DECL_NSIWEBBROWSERCHROME
NS_DECL_NSIWEBBROWSERCHROME2
NS_DECL_NSIWINDOWPROVIDER
NS_DECL_NSIDOCSHELLTREEOWNER_MOZILLA_1_8_BRANCH
protected:
nsContentTreeOwner(PRBool fPrimary);

Просмотреть файл

@ -127,7 +127,7 @@ protected:
NS_IMETHOD GetWindowDOMElement(nsIDOMElement** aDOMElement);
NS_IMETHOD GetDOMElementById(char* aID, nsIDOMElement** aDOMElement);
// See nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH for docs on next two methods
// See nsIDocShellTreeOwner for docs on next two methods
NS_HIDDEN_(nsresult) ContentShellAdded(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, PRBool aTargetable,
const nsAString& aID);