From 0250ce1107260d83bbcf23a0bcf1d50ff26e5a21 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Fri, 15 Feb 2013 12:02:08 +1300 Subject: [PATCH] b=609784 rename DBus Notifications nsAlertsService to resolve collision with XP service r=roc --HG-- rename : toolkit/system/gnome/nsAlertsService.cpp => toolkit/system/gnome/nsSystemAlertsService.cpp rename : toolkit/system/gnome/nsAlertsService.h => toolkit/system/gnome/nsSystemAlertsService.h extra : rebase_source : 1f28a0e16cfd2e7a6c6cec68b7e497f0d0aede39 --- toolkit/system/gnome/Makefile.in | 2 +- toolkit/system/gnome/nsAlertsService.cpp | 42 ----------------- toolkit/system/gnome/nsGnomeModule.cpp | 6 +-- .../system/gnome/nsSystemAlertsService.cpp | 45 +++++++++++++++++++ ...lertsService.h => nsSystemAlertsService.h} | 12 ++--- 5 files changed, 55 insertions(+), 52 deletions(-) delete mode 100644 toolkit/system/gnome/nsAlertsService.cpp create mode 100644 toolkit/system/gnome/nsSystemAlertsService.cpp rename toolkit/system/gnome/{nsAlertsService.h => nsSystemAlertsService.h} (66%) diff --git a/toolkit/system/gnome/Makefile.in b/toolkit/system/gnome/Makefile.in index 0f18c2a35f9..efcbbed2e2c 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 3bf4f9a0804..00000000000 --- 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 9e7d7c146cf..88dacbdca51 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 00000000000..d854602aa90 --- /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 fa62a85c303..eb6cbfabc3c 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__ */