Bug 864166 - Part d: Outparamdel nsGlobalWindow::GetWebBrowserChrome; r=mounir

This commit is contained in:
Ms2ger 2013-04-26 08:51:04 +02:00
parent 58d00148c2
commit 9a7742a5f9
3 changed files with 9 additions and 15 deletions

View File

@ -94,9 +94,7 @@ nsBarProp::GetBrowserChrome()
if (!domwin)
return nullptr;
nsIWebBrowserChrome *browserChrome = nullptr;
mDOMWindow->GetWebBrowserChrome(&browserChrome);
return browserChrome;
return mDOMWindow->GetWebBrowserChrome();
}
//

View File

@ -3892,9 +3892,8 @@ nsGlobalWindow::SetStatus(const nsAString& aStatus)
return NS_OK;
}
nsCOMPtr<nsIWebBrowserChrome> browserChrome;
GetWebBrowserChrome(getter_AddRefs(browserChrome));
if(browserChrome) {
nsCOMPtr<nsIWebBrowserChrome> browserChrome = GetWebBrowserChrome();
if (browserChrome) {
browserChrome->SetStatus(nsIWebBrowserChrome::STATUS_SCRIPT,
PromiseFlatString(aStatus).get());
}
@ -9769,8 +9768,7 @@ nsGlobalWindow::OpenInternal(const nsAString& aUrl, const nsAString& aName,
*aReturn = nullptr;
nsCOMPtr<nsIWebBrowserChrome> chrome;
GetWebBrowserChrome(getter_AddRefs(chrome));
nsCOMPtr<nsIWebBrowserChrome> chrome = GetWebBrowserChrome();
if (!chrome) {
// No chrome means we don't want to go through with this open call
// -- see nsIWindowWatcher.idl
@ -10739,15 +10737,13 @@ nsGlobalWindow::GetTreeOwnerWindow()
return baseWindow.forget();
}
nsresult
nsGlobalWindow::GetWebBrowserChrome(nsIWebBrowserChrome **aBrowserChrome)
already_AddRefed<nsIWebBrowserChrome>
nsGlobalWindow::GetWebBrowserChrome()
{
nsCOMPtr<nsIDocShellTreeOwner> treeOwner = GetTreeOwner();
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(treeOwner));
NS_IF_ADDREF(*aBrowserChrome = browserChrome);
return NS_OK;
nsCOMPtr<nsIWebBrowserChrome> browserChrome = do_GetInterface(treeOwner);
return browserChrome.forget();
}
nsIScrollableFrame *

View File

@ -891,7 +891,7 @@ protected:
// Helper Functions
already_AddRefed<nsIDocShellTreeOwner> GetTreeOwner();
already_AddRefed<nsIBaseWindow> GetTreeOwnerWindow();
nsresult GetWebBrowserChrome(nsIWebBrowserChrome** aBrowserChrome);
already_AddRefed<nsIWebBrowserChrome> GetWebBrowserChrome();
nsresult SecurityCheckURL(const char *aURL);
nsresult BuildURIfromBase(const char *aURL,
nsIURI **aBuiltURI,