Bug 516747 part 3. Make TabChild and TabParent cooperate on window opening at least to the extent of doing all window opens in new tabs. r=bsmedberg

This commit is contained in:
Boris Zbarsky
2009-12-31 20:35:55 -05:00
parent 5f91dca409
commit 6266daa343
8 changed files with 83 additions and 5 deletions

View File

@@ -98,6 +98,8 @@
#include "nsIContentViewer.h"
#include "nsIView.h"
#include "nsIDOMChromeWindow.h"
#ifdef MOZ_WIDGET_GTK2
#include "mozcontainer.h"
@@ -1456,6 +1458,16 @@ nsFrameLoader::TryNewProcess()
if (mChildProcess) {
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(mOwnerContent);
mChildProcess->SetOwnerElement(element);
nsCOMPtr<nsIDocShellTreeItem> rootItem;
parentAsItem->GetRootTreeItem(getter_AddRefs(rootItem));
nsCOMPtr<nsIDOMWindow> rootWin = do_GetInterface(rootItem);
nsCOMPtr<nsIDOMChromeWindow> rootChromeWin = do_QueryInterface(rootWin);
NS_ABORT_IF_FALSE(rootChromeWin, "How did we not get a chrome window here?");
nsCOMPtr<nsIBrowserDOMWindow> browserDOMWin;
rootChromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin));
mChildProcess->SetBrowserDOMWindow(browserDOMWin);
}
return true;
}