Bug 353353. Remove unused nsIObserver impl from toolkit/xre/nsNativeAppSupportWin.cpp. r=rob_strong

This commit is contained in:
dougt@meer.net
2006-09-22 14:40:55 +00:00
parent 3baf2eb51e
commit 15f3bc0d9e
3 changed files with 4 additions and 53 deletions

View File

@@ -53,7 +53,6 @@
#include "nsNetUtil.h"
#include "nsShellService.h"
#include "nsWindowsShellService.h"
#include "nsIObserverService.h"
#include "nsIProcess.h"
#include "nsICategoryManager.h"
#include "nsBrowserCompsCID.h"
@@ -76,7 +75,7 @@
#define REG_FAILED(val) \
(val != ERROR_SUCCESS)
NS_IMPL_ISUPPORTS3(nsWindowsShellService, nsIWindowsShellService, nsIShellService, nsIObserver)
NS_IMPL_ISUPPORTS2(nsWindowsShellService, nsIWindowsShellService, nsIShellService)
static nsresult
OpenUserKeyForReading(HKEY aStartKey, const char* aKeyName, HKEY* aKey)
@@ -290,24 +289,6 @@ static SETTING gSettings[] = {
// firefox.exe\shell\safemode (default) REG_SZ Firefox &Safe Mode
};
NS_IMETHODIMP
nsWindowsShellService::Register(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation,
const char *componentType, const nsModuleComponentInfo *info)
{
nsresult rv;
nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
return catman->AddCategoryEntry("app-startup", "Windows Shell Service", "service," NS_SHELLSERVICE_CONTRACTID, PR_TRUE, PR_TRUE, nsnull);
}
nsWindowsShellService::nsWindowsShellService()
:mCheckedThisSession(PR_FALSE)
{
nsCOMPtr<nsIObserverService> obsServ (do_GetService("@mozilla.org/observer-service;1"));
obsServ->AddObserver(this, "quit-application", PR_FALSE);
}
NS_IMETHODIMP
nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck, PRBool* aIsDefaultBrowser)
{
@@ -995,28 +976,6 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
return PR_FALSE;
}
NS_IMETHODIMP
nsWindowsShellService::Observe(nsISupports* aObject, const char* aTopic, const PRUnichar* aMessage)
{
if (!nsCRT::strcmp("app-startup", aTopic)) {
PRBool isDefault;
IsDefaultBrowser(PR_FALSE, &isDefault);
if (!isDefault)
return NS_OK;
}
else if (!nsCRT::strcmp("quit-application", aTopic)) {
PRBool isDefault;
IsDefaultBrowser(PR_FALSE, &isDefault);
if (!isDefault)
return NS_OK;
nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));
os->RemoveObserver(this, "quit-application");
}
return NS_OK;
}
NS_IMETHODIMP
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
{