diff --git a/mozilla/xpfe/appshell/src/nsXULWindow.cpp b/mozilla/xpfe/appshell/src/nsXULWindow.cpp index b1028d428a5..71216c3a417 100644 --- a/mozilla/xpfe/appshell/src/nsXULWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsXULWindow.cpp @@ -42,6 +42,7 @@ #include "nsIIOService.h" #include "nsIJSContextStack.h" #include "nsIMarkupDocumentViewer.h" +#include "nsIObserverService.h" #include "nsIWindowMediator.h" // XXX Get rid of this @@ -119,6 +120,20 @@ NS_IMETHODIMP nsXULWindow::GetDocShell(nsIDocShell** aDocShell) return NS_OK; } +NS_IMETHODIMP nsXULWindow::SetIntrinsicallySized(PRBool aIntrinsicallySized) +{ + mIntrinsicallySized = aIntrinsicallySized; + return NS_OK; +} + +NS_IMETHODIMP nsXULWindow::GetIntrinsicallySized(PRBool* aIntrinsicallySized) +{ + NS_ENSURE_ARG_POINTER(aIntrinsicallySized); + + *aIntrinsicallySized = mIntrinsicallySized; + return NS_OK; +} + NS_IMETHODIMP nsXULWindow::GetPrimaryContentShell(nsIDocShellTreeItem** aDocShellTreeItem) { @@ -511,8 +526,6 @@ NS_IMETHODIMP nsXULWindow::SetFocus() NS_IMETHODIMP nsXULWindow::FocusAvailable(nsIBaseWindow* aCurrentFocus, PRBool* aTookFocus) { - //XXX First Check In - NS_ASSERTION(PR_FALSE, "Not Yet Implemented"); return NS_OK; } @@ -1034,6 +1047,31 @@ NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags, return NS_OK; } +// XXX can this switch now? +/// This should rightfully be somebody's PROGID? +// Will switch when the "app shell browser component" arrives. +static const char *prefix = "component://netscape/appshell/component/browser/window"; + +NS_IMETHODIMP nsXULWindow::NotifyObservers(const PRUnichar* aTopic, + const PRUnichar* aData) +{ + nsCOMPtr service(do_GetService(NS_OBSERVERSERVICE_PROGID)); + + if(!service) + return NS_ERROR_FAILURE; + + nsCOMPtr + removeme(do_QueryInterface(NS_STATIC_CAST(nsIXULWindow*, this))); + + nsAutoString topic(prefix); + topic += ";"; + topic += aTopic; + + NS_ENSURE_SUCCESS(service->Notify(removeme, topic.GetUnicode(), aData), + NS_ERROR_FAILURE); + return NS_OK; +} + //***************************************************************************** // nsXULWindow: Accessors //*****************************************************************************