зеркало из https://github.com/mozilla/pjs.git
Bug 250202 remove nsWebShellWindow::NotifyObservers and nsXULWindow::NotifyObservers
r=danm sr=jag
This commit is contained in:
Родитель
ccbc55e0d0
Коммит
ea9c2b0afe
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче