Use the nsIWebBrowserChrome interface to set the status rather than the old nsIBrowserWindow interface.

This commit is contained in:
tbogard%aol.net 2000-03-11 00:41:57 +00:00
parent bf5156a460
commit 7b6b143608
2 changed files with 18 additions and 48 deletions

View File

@ -45,13 +45,14 @@
#include "nsIJVMPluginTagInfo.h"
#include "nsIWebShell.h"
#include "nsIInterfaceRequestor.h"
#include "nsIBrowserWindow.h"
#include "nsINameSpaceManager.h"
#include "nsIEventListener.h"
#include "nsITimer.h"
#include "nsITimerCallback.h"
#include "nsLayoutAtoms.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIWebBrowserChrome.h"
#include "nsIDOMElement.h"
// XXX For temporary paint code
@ -1503,8 +1504,6 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner()
mContext = nsnull;
}
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
NS_IMPL_ADDREF(nsPluginInstanceOwner);
NS_IMPL_RELEASE(nsPluginInstanceOwner);
@ -1789,31 +1788,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const char *aStatusMsg)
nsCOMPtr<nsIDocShellTreeItem> docShellItem(do_QueryInterface(cont));
if (docShellItem)
{
nsCOMPtr<nsIDocShellTreeItem> root;
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
docShellItem->GetTreeOwner(getter_AddRefs(treeOwner));
docShellItem->GetSameTypeRootTreeItem(getter_AddRefs(root));
nsCOMPtr<nsIWebShell> rootWebShell(do_QueryInterface(root));
if (rootWebShell)
if(treeOwner)
{
nsCOMPtr<nsIWebShellContainer> rootContainer;
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(treeOwner));
rv = rootWebShell->GetContainer(*getter_AddRefs(rootContainer));
if (nsnull != rootContainer)
if(browserChrome)
{
nsCOMPtr<nsIBrowserWindow> browserWindow(do_QueryInterface(rootContainer));
if(browserWindow)
{
if (rootContainer)
{
nsAutoString msg = nsAutoString(aStatusMsg);
rv = browserWindow->SetStatus(msg.GetUnicode());
}
}
nsAutoString msg = nsAutoString(aStatusMsg);
browserChrome->SetJSStatus(msg.GetUnicode());
}
}
}

View File

@ -45,13 +45,14 @@
#include "nsIJVMPluginTagInfo.h"
#include "nsIWebShell.h"
#include "nsIInterfaceRequestor.h"
#include "nsIBrowserWindow.h"
#include "nsINameSpaceManager.h"
#include "nsIEventListener.h"
#include "nsITimer.h"
#include "nsITimerCallback.h"
#include "nsLayoutAtoms.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIWebBrowserChrome.h"
#include "nsIDOMElement.h"
// XXX For temporary paint code
@ -1503,8 +1504,6 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner()
mContext = nsnull;
}
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
NS_IMPL_ADDREF(nsPluginInstanceOwner);
NS_IMPL_RELEASE(nsPluginInstanceOwner);
@ -1789,31 +1788,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const char *aStatusMsg)
nsCOMPtr<nsIDocShellTreeItem> docShellItem(do_QueryInterface(cont));
if (docShellItem)
{
nsCOMPtr<nsIDocShellTreeItem> root;
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
docShellItem->GetTreeOwner(getter_AddRefs(treeOwner));
docShellItem->GetSameTypeRootTreeItem(getter_AddRefs(root));
nsCOMPtr<nsIWebShell> rootWebShell(do_QueryInterface(root));
if (rootWebShell)
if(treeOwner)
{
nsCOMPtr<nsIWebShellContainer> rootContainer;
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(treeOwner));
rv = rootWebShell->GetContainer(*getter_AddRefs(rootContainer));
if (nsnull != rootContainer)
if(browserChrome)
{
nsCOMPtr<nsIBrowserWindow> browserWindow(do_QueryInterface(rootContainer));
if(browserWindow)
{
if (rootContainer)
{
nsAutoString msg = nsAutoString(aStatusMsg);
rv = browserWindow->SetStatus(msg.GetUnicode());
}
}
nsAutoString msg = nsAutoString(aStatusMsg);
browserChrome->SetJSStatus(msg.GetUnicode());
}
}
}