diff --git a/toolkit/system/gnome/Makefile.in b/toolkit/system/gnome/Makefile.in index 0f18c2a35f9d..efcbbed2e2c8 100644 --- a/toolkit/system/gnome/Makefile.in +++ b/toolkit/system/gnome/Makefile.in @@ -18,7 +18,7 @@ FAIL_ON_WARNINGS = 1 CPPSRCS = \ nsGnomeModule.cpp \ - nsAlertsService.cpp \ + nsSystemAlertsService.cpp \ nsAlertsIconListener.cpp \ $(NULL) diff --git a/toolkit/system/gnome/nsAlertsService.cpp b/toolkit/system/gnome/nsAlertsService.cpp deleted file mode 100644 index 3bf4f9a08040..000000000000 --- a/toolkit/system/gnome/nsAlertsService.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsAlertsService.h" -#include "nsAlertsIconListener.h" -#include "nsAutoPtr.h" - -NS_IMPL_THREADSAFE_ADDREF(nsAlertsService) -NS_IMPL_THREADSAFE_RELEASE(nsAlertsService) - -NS_INTERFACE_MAP_BEGIN(nsAlertsService) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService) - NS_INTERFACE_MAP_ENTRY(nsIAlertsService) -NS_INTERFACE_MAP_END_THREADSAFE - -nsAlertsService::nsAlertsService() -{} - -nsAlertsService::~nsAlertsService() -{} - -nsresult -nsAlertsService::Init() -{ - return NS_OK; -} - -NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle, - const nsAString & aAlertText, bool aAlertTextClickable, - const nsAString & aAlertCookie, - nsIObserver * aAlertListener, - const nsAString & aAlertName) -{ - nsRefPtr alertListener = new nsAlertsIconListener(); - if (!alertListener) - return NS_ERROR_OUT_OF_MEMORY; - - return alertListener->InitAlertAsync(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable, - aAlertCookie, aAlertListener); -} diff --git a/toolkit/system/gnome/nsGnomeModule.cpp b/toolkit/system/gnome/nsGnomeModule.cpp index 9e7d7c146cf7..88dacbdca511 100644 --- a/toolkit/system/gnome/nsGnomeModule.cpp +++ b/toolkit/system/gnome/nsGnomeModule.cpp @@ -22,8 +22,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSService, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init) #endif -#include "nsAlertsService.h" -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAlertsService, Init) +#include "nsSystemAlertsService.h" +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemAlertsService, Init) #ifdef MOZ_ENABLE_GCONF NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID); @@ -49,7 +49,7 @@ static const mozilla::Module::CIDEntry kGnomeCIDs[] = { { &kNS_GIOSERVICE_CID, false, NULL, nsGIOServiceConstructor }, { &kNS_GSETTINGSSERVICE_CID, false, NULL, nsGSettingsServiceConstructor }, #endif - { &kNS_SYSTEMALERTSSERVICE_CID, false, NULL, nsAlertsServiceConstructor }, + { &kNS_SYSTEMALERTSSERVICE_CID, false, NULL, nsSystemAlertsServiceConstructor }, { NULL } }; diff --git a/toolkit/system/gnome/nsSystemAlertsService.cpp b/toolkit/system/gnome/nsSystemAlertsService.cpp new file mode 100644 index 000000000000..d854602aa909 --- /dev/null +++ b/toolkit/system/gnome/nsSystemAlertsService.cpp @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsSystemAlertsService.h" +#include "nsAlertsIconListener.h" +#include "nsAutoPtr.h" + +NS_IMPL_THREADSAFE_ADDREF(nsSystemAlertsService) +NS_IMPL_THREADSAFE_RELEASE(nsSystemAlertsService) + +NS_INTERFACE_MAP_BEGIN(nsSystemAlertsService) + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService) + NS_INTERFACE_MAP_ENTRY(nsIAlertsService) +NS_INTERFACE_MAP_END_THREADSAFE + +nsSystemAlertsService::nsSystemAlertsService() +{} + +nsSystemAlertsService::~nsSystemAlertsService() +{} + +nsresult +nsSystemAlertsService::Init() +{ + return NS_OK; +} + +NS_IMETHODIMP +nsSystemAlertsService::ShowAlertNotification(const nsAString & aImageUrl, + const nsAString & aAlertTitle, + const nsAString & aAlertText, + bool aAlertTextClickable, + const nsAString & aAlertCookie, + nsIObserver * aAlertListener, + const nsAString & aAlertName) +{ + nsRefPtr alertListener = new nsAlertsIconListener(); + if (!alertListener) + return NS_ERROR_OUT_OF_MEMORY; + + return alertListener->InitAlertAsync(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable, + aAlertCookie, aAlertListener); +} diff --git a/toolkit/system/gnome/nsAlertsService.h b/toolkit/system/gnome/nsSystemAlertsService.h similarity index 66% rename from toolkit/system/gnome/nsAlertsService.h rename to toolkit/system/gnome/nsSystemAlertsService.h index fa62a85c303c..eb6cbfabc3c0 100644 --- a/toolkit/system/gnome/nsAlertsService.h +++ b/toolkit/system/gnome/nsSystemAlertsService.h @@ -3,20 +3,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef nsAlertsService_h__ -#define nsAlertsService_h__ +#ifndef nsSystemAlertsService_h__ +#define nsSystemAlertsService_h__ #include "nsIAlertsService.h" #include "nsCOMPtr.h" -class nsAlertsService : public nsIAlertsService +class nsSystemAlertsService : public nsIAlertsService { public: NS_DECL_NSIALERTSSERVICE NS_DECL_ISUPPORTS - nsAlertsService(); - virtual ~nsAlertsService(); + nsSystemAlertsService(); + virtual ~nsSystemAlertsService(); nsresult Init(); @@ -24,4 +24,4 @@ protected: }; -#endif /* nsAlertsService_h__ */ +#endif /* nsSystemAlertsService_h__ */