mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Adding support to get to the nsIWebBrowser from the browser element. Fix for 27161. r=pavlov a=jevering
This commit is contained in:
parent
168ad6720e
commit
ada2eb3f19
@ -75,7 +75,21 @@ nsXULBrowserElement::GetWebBrowser(nsIWebBrowser** aWebBrowser)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aWebBrowser);
|
||||
|
||||
NS_ERROR("Not Yet Implemented");
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(mOuter));
|
||||
nsCOMPtr<nsIDocument> document;
|
||||
content->GetDocument(*getter_AddRefs(document));
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
// First we need to obtain the popup set frame that encapsulates the target popup.
|
||||
// Without a popup set, we're dead in the water.
|
||||
nsCOMPtr<nsIPresShell> presShell = getter_AddRefs(document->GetShellAt(0));
|
||||
if(!presShell)
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsISupports> subShell;
|
||||
presShell->GetSubShellFor(content, getter_AddRefs(subShell));
|
||||
if(!subShell)
|
||||
return NS_OK;
|
||||
|
||||
CallQueryInterface(subShell, aWebBrowser);
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user