diff --git a/mozilla/browser/components/build/nsModule.cpp b/mozilla/browser/components/build/nsModule.cpp index 68a7c9eb271..bac0d6b0e94 100644 --- a/mozilla/browser/components/build/nsModule.cpp +++ b/mozilla/browser/components/build/nsModule.cpp @@ -124,8 +124,7 @@ static const nsModuleComponentInfo components[] = { "Browser Shell Service", NS_SHELLSERVICE_CID, NS_SHELLSERVICE_CONTRACTID, - nsWindowsShellServiceConstructor, - nsWindowsShellService::Register }, + nsWindowsShellServiceConstructor}, #elif defined(MOZ_WIDGET_GTK2) { "Browser Shell Service", diff --git a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp index 9c30bcc50ea..1c8b4e62af1 100644 --- a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp +++ b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp @@ -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 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 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 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) { diff --git a/mozilla/browser/components/shell/src/nsWindowsShellService.h b/mozilla/browser/components/shell/src/nsWindowsShellService.h index 5ca91e3ab5f..065ee213918 100644 --- a/mozilla/browser/components/shell/src/nsWindowsShellService.h +++ b/mozilla/browser/components/shell/src/nsWindowsShellService.h @@ -41,25 +41,18 @@ #include "nscore.h" #include "nsIWindowsShellService.h" -#include "nsIObserver.h" -#include "nsIGenericFactory.h" #include -class nsWindowsShellService : public nsIWindowsShellService, - public nsIObserver +class nsWindowsShellService : public nsIWindowsShellService { public: - nsWindowsShellService(); + nsWindowsShellService() : mCheckedThisSession(PR_FALSE) {}; virtual ~nsWindowsShellService() {}; NS_DECL_ISUPPORTS NS_DECL_NSISHELLSERVICE NS_DECL_NSIWINDOWSSHELLSERVICE - NS_DECL_NSIOBSERVER - - static NS_METHOD Register(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, - const char *componentType, const nsModuleComponentInfo *info); protected: PRBool GetMailAccountKey(HKEY* aResult);