зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
30387514ec
Коммит
30b2c67803
|
@ -18,7 +18,7 @@ FAIL_ON_WARNINGS = 1
|
|||
|
||||
CPPSRCS = \
|
||||
nsGnomeModule.cpp \
|
||||
nsAlertsService.cpp \
|
||||
nsSystemAlertsService.cpp \
|
||||
nsAlertsIconListener.cpp \
|
||||
$(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<nsAlertsIconListener> alertListener = new nsAlertsIconListener();
|
||||
if (!alertListener)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
return alertListener->InitAlertAsync(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
|
||||
aAlertCookie, aAlertListener);
|
||||
}
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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__ */
|
Загрузка…
Ссылка в новой задаче