Bug 250202 remove nsWebShellWindow::NotifyObservers and nsXULWindow::NotifyObservers

r=danm sr=jag
This commit is contained in:
cbiesinger%web.de 2004-07-15 19:00:11 +00:00
Родитель ccbc55e0d0
Коммит ea9c2b0afe
4 изменённых файлов: 0 добавлений и 53 удалений

Просмотреть файл

@ -1583,31 +1583,6 @@ nsWebShellWindow::ContentRemoved(nsIDocument *aDocument,
{
}
// This should rightfully be somebody's CONTRACTID?
// Will switch when the "app shell browser component" arrives.
static const char *prefix = "@mozilla.org/appshell/component/browser/window;1";
nsresult
nsWebShellWindow::NotifyObservers( const nsString &aTopic, const nsString &someData ) {
nsresult rv = NS_OK;
// Get observer service.
nsIObserverService *svc = 0;
rv = nsServiceManager::GetService( "@mozilla.org/observer-service;1",
NS_GET_IID(nsIObserverService),
(nsISupports**)&svc );
if ( NS_SUCCEEDED( rv ) && svc ) {
// Notify observers as instructed; the subject is "this" web shell window.
nsCAutoString topic; topic.Assign(prefix);
topic.Append(";");
topic.AppendWithConversion(aTopic);
rv = svc->NotifyObservers( (nsIWebShellWindow*)this, topic.get(), someData.get() );
// Release the service.
nsServiceManager::ReleaseService( "@mozilla.org/observer-service;1", svc );
} else {
}
return rv;
}
// nsIBaseWindow
NS_IMETHODIMP nsWebShellWindow::Destroy()
{

Просмотреть файл

@ -139,8 +139,6 @@ protected:
static nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent);
nsresult NotifyObservers( const nsString &aTopic, const nsString &someData );
nsIWebShell* mWebShell;
PRBool mLockedUntilChromeLoad;
PRBool mLoadDefaultPage;

Просмотреть файл

@ -1865,31 +1865,6 @@ NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags,
return NS_OK;
}
// XXX can this switch now?
/// This should rightfully be somebody's CONTRACTID?
// Will switch when the "app shell browser component" arrives.
static const char *prefix = "@mozilla.org/appshell/component/browser/window;1";
NS_IMETHODIMP nsXULWindow::NotifyObservers(const PRUnichar* aTopic,
const PRUnichar* aData)
{
nsCOMPtr<nsIObserverService> service(do_GetService("@mozilla.org/observer-service;1"));
if(!service)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIWebShellWindow>
removeme(do_QueryInterface(NS_STATIC_CAST(nsIXULWindow*, this)));
nsCAutoString topic; topic.Assign(prefix);
topic.Append(";");
topic.AppendWithConversion(aTopic);
NS_ENSURE_SUCCESS(service->NotifyObservers(removeme, topic.get(), aData),
NS_ERROR_FAILURE);
return NS_OK;
}
void nsXULWindow::EnableParent(PRBool aEnable)
{
nsCOMPtr<nsIBaseWindow> parentWindow;

Просмотреть файл

@ -121,7 +121,6 @@ protected:
nsIXULWindow **_retval);
NS_IMETHOD CreateNewContentWindow(PRInt32 aChromeFlags,
nsIXULWindow **_retval);
NS_IMETHOD NotifyObservers(const PRUnichar* aTopic, const PRUnichar* aData);
void EnableParent(PRBool aEnable);
PRBool ConstrainToZLevel(PRBool aImmediate, nsWindowZ *aPlacement,