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
This commit is contained in:
Karl Tomlinson 2013-02-15 12:02:08 +13:00
parent ee059e24ad
commit d074e6bfa0
5 changed files with 55 additions and 52 deletions

View File

@ -18,7 +18,7 @@ FAIL_ON_WARNINGS = 1
CPPSRCS = \
nsGnomeModule.cpp \
nsAlertsService.cpp \
nsSystemAlertsService.cpp \
nsAlertsIconListener.cpp \
$(NULL)

View File

@ -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<nsAlertsIconListener> alertListener = new nsAlertsIconListener();
if (!alertListener)
return NS_ERROR_OUT_OF_MEMORY;
return alertListener->InitAlertAsync(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
aAlertCookie, aAlertListener);
}

View File

@ -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 }
};

View File

@ -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<nsAlertsIconListener> alertListener = new nsAlertsIconListener();
if (!alertListener)
return NS_ERROR_OUT_OF_MEMORY;
return alertListener->InitAlertAsync(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
aAlertCookie, aAlertListener);
}

View File

@ -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__ */