From 7b6b143608e27077996fece01a551f4a2d4bc3ed Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Sat, 11 Mar 2000 00:41:57 +0000 Subject: [PATCH] Use the nsIWebBrowserChrome interface to set the status rather than the old nsIBrowserWindow interface. --- layout/generic/nsObjectFrame.cpp | 33 +++++++------------------- layout/html/base/src/nsObjectFrame.cpp | 33 +++++++------------------- 2 files changed, 18 insertions(+), 48 deletions(-) diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 457cd09e3140..2367b784ecc7 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -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 docShellItem(do_QueryInterface(cont)); if (docShellItem) { - nsCOMPtr root; + nsCOMPtr treeOwner; + docShellItem->GetTreeOwner(getter_AddRefs(treeOwner)); - docShellItem->GetSameTypeRootTreeItem(getter_AddRefs(root)); - - nsCOMPtr rootWebShell(do_QueryInterface(root)); - - if (rootWebShell) + if(treeOwner) { - nsCOMPtr rootContainer; + nsCOMPtr browserChrome(do_GetInterface(treeOwner)); - rv = rootWebShell->GetContainer(*getter_AddRefs(rootContainer)); - - if (nsnull != rootContainer) + if(browserChrome) { - nsCOMPtr 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()); } } } diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index 457cd09e3140..2367b784ecc7 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -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 docShellItem(do_QueryInterface(cont)); if (docShellItem) { - nsCOMPtr root; + nsCOMPtr treeOwner; + docShellItem->GetTreeOwner(getter_AddRefs(treeOwner)); - docShellItem->GetSameTypeRootTreeItem(getter_AddRefs(root)); - - nsCOMPtr rootWebShell(do_QueryInterface(root)); - - if (rootWebShell) + if(treeOwner) { - nsCOMPtr rootContainer; + nsCOMPtr browserChrome(do_GetInterface(treeOwner)); - rv = rootWebShell->GetContainer(*getter_AddRefs(rootContainer)); - - if (nsnull != rootContainer) + if(browserChrome) { - nsCOMPtr 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()); } } }