From 4a3661ba6f646844c3b3cfd9ded44152597ca8a8 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Mon, 14 Feb 2000 06:13:12 +0000 Subject: [PATCH] Added the implementation for FocusAvailable. Added implementation for the new intrinsicSizing attribute. Moved over the NotifyObservers() call from nsWebShellWindow. r=hyatt git-svn-id: svn://10.0.0.236/trunk@60697 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/appshell/src/nsXULWindow.cpp | 42 +++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) 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 //*****************************************************************************