Fixed libnotify patch

This commit is contained in:
Martin Stransky 2014-12-01 12:04:12 +01:00
parent 3d23209eb3
commit 90cf500b2f
4 changed files with 208 additions and 291 deletions

View File

@ -148,8 +148,6 @@ Patch217: firefox-baseline-disable.patch
# Upstream patches # Upstream patches
Patch300: mozilla-858919.patch Patch300: mozilla-858919.patch
Patch301: mozilla-858919-2.patch
Patch302: mozilla-858919-3.patch
# Gtk3 upstream patches # Gtk3 upstream patches
Patch402: mozilla-gtk3-tab-size.patch Patch402: mozilla-gtk3-tab-size.patch
@ -297,8 +295,6 @@ cd %{tarballdir}
# Upstream patches # Upstream patches
%patch300 -p1 -b .858919 %patch300 -p1 -b .858919
%patch301 -p1 -b .858919
%patch302 -p1 -b .858919
%if %{toolkit_gtk3} %if %{toolkit_gtk3}
%patch402 -p1 -b .gtk3-tab-size %patch402 -p1 -b .gtk3-tab-size

View File

@ -1,28 +0,0 @@
# HG changeset patch
# Parent 9d66436af432f057f65d16ab9f5871baca4ada78
# User Martin Stransky <stransky@redhat.com>
Bug 858919 - Send "alertshow" event for Web Notifications by libnotify, r=?karlt
diff --git a/toolkit/system/gnome/nsAlertsIconListener.cpp b/toolkit/system/gnome/nsAlertsIconListener.cpp
--- a/toolkit/system/gnome/nsAlertsIconListener.cpp
+++ b/toolkit/system/gnome/nsAlertsIconListener.cpp
@@ -175,16 +175,19 @@ nsAlertsIconListener::ShowAlert(GdkPixbu
// different signature, so a marshaller is used instead of a C callback to
// get the user_data (this) in a parseable format. |closure| is created
// with a floating reference, which gets sunk by g_signal_connect_closure().
GClosure* closure = g_closure_new_simple(sizeof(GClosure), this);
g_closure_set_marshal(closure, notify_closed_marshal);
mClosureHandler = g_signal_connect_closure(mNotification, "closed", closure, FALSE);
gboolean result = notify_notification_show(mNotification, nullptr);
+ if (result && mAlertListener)
+ mAlertListener->Observe(nullptr, "alertshow", mAlertCookie.get());
+
return result ? NS_OK : NS_ERROR_FAILURE;
}
nsresult
nsAlertsIconListener::StartRequest(const nsAString & aImageUrl)
{
if (mIconRequest) {
// Another icon request is already in flight. Kill it.

View File

@ -1,144 +0,0 @@
# HG changeset patch
# Parent 531e0bc755b2335dec5aae2a10f4ba454307981d
# User Martin Stransky <stransky@redhat.com>
Bug 858919 - Fixes image loading for libnotify notifications. r=?karlt
diff --git a/toolkit/system/gnome/nsAlertsIconListener.cpp b/toolkit/system/gnome/nsAlertsIconListener.cpp
--- a/toolkit/system/gnome/nsAlertsIconListener.cpp
+++ b/toolkit/system/gnome/nsAlertsIconListener.cpp
@@ -46,16 +46,31 @@ static void notify_closed_marshal(GClosu
NS_ABORT_IF_FALSE(n_param_values >= 1, "No object in params");
nsAlertsIconListener* alert =
static_cast<nsAlertsIconListener*>(closure->data);
alert->SendClosed();
NS_RELEASE(alert);
}
+static GdkPixbuf*
+GetPixbufFromImgRequest(imgIRequest* aRequest)
+{
+ nsCOMPtr<imgIContainer> image;
+ nsresult rv = aRequest->GetImage(getter_AddRefs(image));
+ if (NS_FAILED(rv)) {
+ return nullptr;
+ }
+
+ nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
+ do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
+
+ return imgToPixbuf->ConvertImageToPixbuf(image);
+}
+
NS_IMPL_ISUPPORTS(nsAlertsIconListener, imgINotificationObserver,
nsIObserver, nsISupportsWeakReference)
nsAlertsIconListener::nsAlertsIconListener()
: mLoadedFrame(false),
mNotification(nullptr)
{
if (!libNotifyHandle && !libNotifyNotAvail) {
@@ -101,57 +116,55 @@ nsAlertsIconListener::Notify(imgIRequest
}
return NS_OK;
}
nsresult
nsAlertsIconListener::OnStopRequest(imgIRequest* aRequest)
{
+ NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
+
uint32_t imgStatus = imgIRequest::STATUS_ERROR;
nsresult rv = aRequest->GetImageStatus(&imgStatus);
NS_ENSURE_SUCCESS(rv, rv);
if (imgStatus == imgIRequest::STATUS_ERROR && !mLoadedFrame) {
// We have an error getting the image. Display the notification with no icon.
ShowAlert(nullptr);
- }
- if (mIconRequest) {
+ // Cancel any pending request
mIconRequest->Cancel(NS_BINDING_ABORTED);
mIconRequest = nullptr;
}
+
return NS_OK;
}
nsresult
nsAlertsIconListener::OnStopFrame(imgIRequest* aRequest)
{
- if (aRequest != mIconRequest)
- return NS_ERROR_FAILURE;
+ NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
if (mLoadedFrame)
return NS_OK; // only use one frame
- nsCOMPtr<imgIContainer> image;
- nsresult rv = aRequest->GetImage(getter_AddRefs(image));
- if (NS_FAILED(rv))
- return rv;
-
- nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
- do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
-
- GdkPixbuf* imagePixbuf = imgToPixbuf->ConvertImageToPixbuf(image);
- if (!imagePixbuf)
- return NS_ERROR_FAILURE;
-
- ShowAlert(imagePixbuf);
-
- g_object_unref(imagePixbuf);
+ GdkPixbuf* imagePixbuf = GetPixbufFromImgRequest(aRequest);
+ if (!imagePixbuf) {
+ ShowAlert(nullptr);
+ } else {
+ ShowAlert(imagePixbuf);
+ g_object_unref(imagePixbuf);
+ }
mLoadedFrame = true;
+
+ // Cancel any pending request (multipart image loading/decoding for instance)
+ mIconRequest->Cancel(NS_BINDING_ABORTED);
+ mIconRequest = nullptr;
+
return NS_OK;
}
nsresult
nsAlertsIconListener::ShowAlert(GdkPixbuf* aPixbuf)
{
mNotification = notify_notification_new(mAlertTitle.get(), mAlertText.get(),
nullptr, nullptr);
@@ -196,19 +209,25 @@ nsAlertsIconListener::StartRequest(const
NS_NewURI(getter_AddRefs(imageUri), aImageUrl);
if (!imageUri)
return ShowAlert(nullptr);
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1"));
if (!il)
return ShowAlert(nullptr);
- return il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
- this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
- nullptr, getter_AddRefs(mIconRequest));
+ nsresult rv = il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
+ this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
+ nullptr, getter_AddRefs(mIconRequest));
+ if (NS_FAILED(rv))
+ return rv;
+
+ mIconRequest->StartDecoding();
+
+ return NS_OK;
}
void
nsAlertsIconListener::SendCallback()
{
if (mAlertListener)
mAlertListener->Observe(nullptr, "alertclickcallback", mAlertCookie.get());
}

View File

@ -1,33 +1,153 @@
# HG changeset patch diff -up mozilla-release/toolkit/components/alerts/nsAlertsService.cpp.858919 mozilla-release/toolkit/components/alerts/nsAlertsService.cpp
# Parent b17cad2d1e5e6bcb5a10096d51d07ea8a79b6921 --- mozilla-release/toolkit/components/alerts/nsAlertsService.cpp.858919 2014-11-26 03:17:37.000000000 +0100
# User Martin Stransky <stransky@redhat.com> +++ mozilla-release/toolkit/components/alerts/nsAlertsService.cpp 2014-12-01 11:58:31.896101722 +0100
Bug 858919 - Add support for libnotify calls which was removed for new notification API. r=karlt @@ -100,10 +100,12 @@ NS_IMETHODIMP nsAlertsService::ShowAlert
nsCOMPtr<nsIAlertsService> sysAlerts(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
diff --git a/toolkit/system/gnome/moz.build b/toolkit/system/gnome/moz.build nsresult rv;
--- a/toolkit/system/gnome/moz.build if (sysAlerts) {
+++ b/toolkit/system/gnome/moz.build - return sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
@@ -1,15 +1,17 @@ - aAlertCookie, aAlertListener, aAlertName,
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- - aBidi, aLang, aData,
# vim: set filetype=python: - IPC::Principal(aPrincipal));
# This Source Code Form is subject to the terms of the Mozilla Public + rv = sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
# License, v. 2.0. If a copy of the MPL was not distributed with this + aAlertCookie, aAlertListener, aAlertName,
+ aBidi, aLang, aData,
+ IPC::Principal(aPrincipal));
+ if (NS_SUCCEEDED(rv))
+ return NS_OK;
}
if (!ShouldShowAlert()) {
diff -up mozilla-release/toolkit/system/gnome/moz.build.858919 mozilla-release/toolkit/system/gnome/moz.build
--- mozilla-release/toolkit/system/gnome/moz.build.858919 2014-11-26 03:17:39.000000000 +0100
+++ mozilla-release/toolkit/system/gnome/moz.build 2014-12-01 11:58:31.896101722 +0100
@@ -5,7 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
SOURCES += [ SOURCES += [
+ 'nsAlertsIconListener.cpp', + 'nsAlertsIconListener.cpp',
+ 'nsAlertsService.cpp',
'nsGnomeModule.cpp', 'nsGnomeModule.cpp',
+ 'nsSystemAlertsService.cpp',
] ]
if CONFIG['MOZ_ENABLE_GCONF']: if CONFIG['MOZ_ENABLE_GCONF']:
SOURCES += [ diff -up mozilla-release/toolkit/system/gnome/nsAlertsIconListener.cpp.858919 mozilla-release/toolkit/system/gnome/nsAlertsIconListener.cpp
'nsGConfService.cpp', --- mozilla-release/toolkit/system/gnome/nsAlertsIconListener.cpp.858919 2014-11-26 03:17:39.000000000 +0100
] +++ mozilla-release/toolkit/system/gnome/nsAlertsIconListener.cpp 2014-12-01 12:00:39.455960137 +0100
@@ -51,6 +51,21 @@ static void notify_closed_marshal(GClosu
NS_RELEASE(alert);
}
diff --git a/toolkit/system/gnome/nsAlertsIconListener.h b/toolkit/system/gnome/nsAlertsIconListener.h +static GdkPixbuf*
new file mode 100644 +GetPixbufFromImgRequest(imgIRequest* aRequest)
--- /dev/null +{
+++ b/toolkit/system/gnome/nsAlertsIconListener.h + nsCOMPtr<imgIContainer> image;
+ nsresult rv = aRequest->GetImage(getter_AddRefs(image));
+ if (NS_FAILED(rv)) {
+ return nullptr;
+ }
+
+ nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
+ do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
+
+ return imgToPixbuf->ConvertImageToPixbuf(image);
+}
+
NS_IMPL_ISUPPORTS(nsAlertsIconListener, imgINotificationObserver,
nsIObserver, nsISupportsWeakReference)
@@ -106,15 +121,15 @@ nsAlertsIconListener::Notify(imgIRequest
nsresult
nsAlertsIconListener::OnStopRequest(imgIRequest* aRequest)
{
+ NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
+
uint32_t imgStatus = imgIRequest::STATUS_ERROR;
nsresult rv = aRequest->GetImageStatus(&imgStatus);
NS_ENSURE_SUCCESS(rv, rv);
if (imgStatus == imgIRequest::STATUS_ERROR && !mLoadedFrame) {
// We have an error getting the image. Display the notification with no icon.
ShowAlert(nullptr);
- }
- if (mIconRequest) {
mIconRequest->Cancel(NS_BINDING_ABORTED);
mIconRequest = nullptr;
}
@@ -124,29 +139,25 @@ nsAlertsIconListener::OnStopRequest(imgI
nsresult
nsAlertsIconListener::OnStopFrame(imgIRequest* aRequest)
{
- if (aRequest != mIconRequest)
- return NS_ERROR_FAILURE;
+ NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
if (mLoadedFrame)
return NS_OK; // only use one frame
- nsCOMPtr<imgIContainer> image;
- nsresult rv = aRequest->GetImage(getter_AddRefs(image));
- if (NS_FAILED(rv))
- return rv;
-
- nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
- do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
-
- GdkPixbuf* imagePixbuf = imgToPixbuf->ConvertImageToPixbuf(image);
- if (!imagePixbuf)
- return NS_ERROR_FAILURE;
+ GdkPixbuf* imagePixbuf = GetPixbufFromImgRequest(aRequest);
+ if (!imagePixbuf) {
+ ShowAlert(nullptr);
+ } else {
+ ShowAlert(imagePixbuf);
+ g_object_unref(imagePixbuf);
+ }
- ShowAlert(imagePixbuf);
+ mLoadedFrame = true;
- g_object_unref(imagePixbuf);
+ // Cancel any pending request (multipart image loading/decoding for instance)
+ mIconRequest->Cancel(NS_BINDING_ABORTED);
+ mIconRequest = nullptr;
- mLoadedFrame = true;
return NS_OK;
}
@@ -180,6 +191,9 @@ nsAlertsIconListener::ShowAlert(GdkPixbu
mClosureHandler = g_signal_connect_closure(mNotification, "closed", closure, FALSE);
gboolean result = notify_notification_show(mNotification, nullptr);
+ if (result && mAlertListener)
+ mAlertListener->Observe(nullptr, "alertshow", mAlertCookie.get());
+
return result ? NS_OK : NS_ERROR_FAILURE;
}
@@ -201,9 +215,15 @@ nsAlertsIconListener::StartRequest(const
if (!il)
return ShowAlert(nullptr);
- return il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
- this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
- nullptr, getter_AddRefs(mIconRequest));
+ nsresult rv = il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
+ this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
+ 0 /* use default */, getter_AddRefs(mIconRequest));
+ if (NS_FAILED(rv))
+ return rv;
+
+ mIconRequest->StartDecoding();
+
+ return NS_OK;
}
void
diff -up mozilla-release/toolkit/system/gnome/nsAlertsIconListener.h.858919 mozilla-release/toolkit/system/gnome/nsAlertsIconListener.h
--- mozilla-release/toolkit/system/gnome/nsAlertsIconListener.h.858919 2014-12-01 11:58:31.896101722 +0100
+++ mozilla-release/toolkit/system/gnome/nsAlertsIconListener.h 2014-12-01 11:58:31.896101722 +0100
@@ -0,0 +1,89 @@ @@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* -*- 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 +/* This Source Code Form is subject to the terms of the Mozilla Public
@ -118,50 +238,86 @@ new file mode 100644
+}; +};
+ +
+#endif +#endif
diff --git a/toolkit/system/gnome/nsAlertsService.cpp b/toolkit/system/gnome/nsAlertsService.cpp diff -up mozilla-release/toolkit/system/gnome/nsGnomeModule.cpp.858919 mozilla-release/toolkit/system/gnome/nsGnomeModule.cpp
new file mode 100644 --- mozilla-release/toolkit/system/gnome/nsGnomeModule.cpp.858919 2014-11-26 03:17:39.000000000 +0100
--- /dev/null +++ mozilla-release/toolkit/system/gnome/nsGnomeModule.cpp 2014-12-01 11:58:31.896101722 +0100
+++ b/toolkit/system/gnome/nsAlertsService.cpp @@ -22,6 +22,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGn
@@ -0,0 +1,53 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
#endif
+#include "nsSystemAlertsService.h"
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemAlertsService, Init)
#ifdef MOZ_ENABLE_GCONF
NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
@@ -33,6 +35,7 @@ NS_DEFINE_NAMED_CID(NS_GNOMEVFSSERVICE_C
NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
#endif
+NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
#ifdef MOZ_ENABLE_GCONF
@@ -45,6 +48,7 @@ static const mozilla::Module::CIDEntry k
{ &kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor },
{ &kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor },
#endif
+ { &kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, nsSystemAlertsServiceConstructor },
{ nullptr }
};
@@ -59,6 +63,7 @@ static const mozilla::Module::ContractID
{ NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
{ NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID },
#endif
+ { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
{ nullptr }
};
diff -up mozilla-release/toolkit/system/gnome/nsSystemAlertsService.cpp.858919 mozilla-release/toolkit/system/gnome/nsSystemAlertsService.cpp
--- mozilla-release/toolkit/system/gnome/nsSystemAlertsService.cpp.858919 2014-12-01 11:58:31.897101728 +0100
+++ mozilla-release/toolkit/system/gnome/nsSystemAlertsService.cpp 2014-12-01 11:58:31.896101722 +0100
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */ +/* -*- 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 +/* 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 + * 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/. */ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ +
+#include "nsXULAppAPI.h" +#include "nsXULAppAPI.h"
+#include "nsAlertsService.h" +#include "nsSystemAlertsService.h"
+#include "nsAlertsIconListener.h" +#include "nsAlertsIconListener.h"
+#include "nsAutoPtr.h" +#include "nsAutoPtr.h"
+ +
+NS_IMPL_ADDREF(nsAlertsService) +NS_IMPL_ADDREF(nsSystemAlertsService)
+NS_IMPL_RELEASE(nsAlertsService) +NS_IMPL_RELEASE(nsSystemAlertsService)
+ +
+NS_INTERFACE_MAP_BEGIN(nsAlertsService) +NS_INTERFACE_MAP_BEGIN(nsSystemAlertsService)
+ NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService) + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService)
+ NS_INTERFACE_MAP_ENTRY(nsIAlertsService) + NS_INTERFACE_MAP_ENTRY(nsIAlertsService)
+NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END_THREADSAFE
+ +
+nsAlertsService::nsAlertsService() +nsSystemAlertsService::nsSystemAlertsService()
+{ +{
+} +}
+ +
+nsAlertsService::~nsAlertsService() +nsSystemAlertsService::~nsSystemAlertsService()
+{} +{}
+ +
+nsresult +nsresult
+nsAlertsService::Init() +nsSystemAlertsService::Init()
+{ +{
+ return NS_OK; + return NS_OK;
+} +}
+ +
+NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle, +NS_IMETHODIMP nsSystemAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle,
+ const nsAString & aAlertText, bool aAlertTextClickable, + const nsAString & aAlertText, bool aAlertTextClickable,
+ const nsAString & aAlertCookie, + const nsAString & aAlertCookie,
+ nsIObserver * aAlertListener, + nsIObserver * aAlertListener,
+ const nsAString & aAlertName, + const nsAString & aAlertName,
+ const nsAString & aBidi, + const nsAString & aBidi,
+ const nsAString & aLang, + const nsAString & aLang,
+ nsIPrincipal * aPrincipal) + const nsAString & aData,
+ nsIPrincipal * aPrincipal)
+{ +{
+ nsRefPtr<nsAlertsIconListener> alertListener = new nsAlertsIconListener(); + nsRefPtr<nsAlertsIconListener> alertListener = new nsAlertsIconListener();
+ if (!alertListener) + if (!alertListener)
@ -171,102 +327,39 @@ new file mode 100644
+ aAlertCookie, aAlertListener); + aAlertCookie, aAlertListener);
+} +}
+ +
+NS_IMETHODIMP nsAlertsService::CloseAlert(const nsAString& aAlertName, +NS_IMETHODIMP nsSystemAlertsService::CloseAlert(const nsAString& aAlertName,
+ nsIPrincipal* aPrincipal) + nsIPrincipal* aPrincipal)
+{ +{
+ return NS_ERROR_NOT_IMPLEMENTED; + return NS_ERROR_NOT_IMPLEMENTED;
+} +}
diff --git a/toolkit/system/gnome/nsAlertsService.h b/toolkit/system/gnome/nsAlertsService.h diff -up mozilla-release/toolkit/system/gnome/nsSystemAlertsService.h.858919 mozilla-release/toolkit/system/gnome/nsSystemAlertsService.h
new file mode 100644 --- mozilla-release/toolkit/system/gnome/nsSystemAlertsService.h.858919 2014-12-01 11:58:31.897101728 +0100
--- /dev/null +++ mozilla-release/toolkit/system/gnome/nsSystemAlertsService.h 2014-12-01 11:58:31.897101728 +0100
+++ b/toolkit/system/gnome/nsAlertsService.h
@@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* -*- 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 +/* 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 + * 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/. */ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ +
+#ifndef nsAlertsService_h__ +#ifndef nsSystemAlertsService_h__
+#define nsAlertsService_h__ +#define nsSystemAlertsService_h__
+ +
+#include "nsIAlertsService.h" +#include "nsIAlertsService.h"
+#include "nsCOMPtr.h" +#include "nsCOMPtr.h"
+ +
+class nsAlertsService : public nsIAlertsService +class nsSystemAlertsService : public nsIAlertsService
+{ +{
+public: +public:
+ NS_DECL_NSIALERTSSERVICE + NS_DECL_NSIALERTSSERVICE
+ NS_DECL_ISUPPORTS + NS_DECL_ISUPPORTS
+ +
+ nsAlertsService(); + nsSystemAlertsService();
+ +
+ nsresult Init(); + nsresult Init();
+ +
+protected: +protected:
+ virtual ~nsAlertsService(); + virtual ~nsSystemAlertsService();
+ +
+}; +};
+ +
+#endif /* nsAlertsService_h__ */ +#endif /* nsSystemAlertsService_h__ */
diff --git a/toolkit/system/gnome/nsGnomeModule.cpp b/toolkit/system/gnome/nsGnomeModule.cpp
--- a/toolkit/system/gnome/nsGnomeModule.cpp
+++ b/toolkit/system/gnome/nsGnomeModule.cpp
@@ -17,53 +17,58 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGC
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSService, Init)
#endif
#ifdef MOZ_ENABLE_GIO
#include "nsGIOService.h"
#include "nsGSettingsService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
#endif
+#include "nsAlertsService.h"
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAlertsService, Init)
#ifdef MOZ_ENABLE_GCONF
NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
#endif
#ifdef MOZ_ENABLE_GNOMEVFS
NS_DEFINE_NAMED_CID(NS_GNOMEVFSSERVICE_CID);
#endif
#ifdef MOZ_ENABLE_GIO
NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
#endif
+NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
#ifdef MOZ_ENABLE_GCONF
{ &kNS_GCONFSERVICE_CID, false, nullptr, nsGConfServiceConstructor },
#endif
#ifdef MOZ_ENABLE_GNOMEVFS
{ &kNS_GNOMEVFSSERVICE_CID, false, nullptr, nsGnomeVFSServiceConstructor },
#endif
#ifdef MOZ_ENABLE_GIO
{ &kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor },
{ &kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor },
#endif
+ { &kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, nsAlertsServiceConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
#ifdef MOZ_ENABLE_GCONF
{ NS_GCONFSERVICE_CONTRACTID, &kNS_GCONFSERVICE_CID },
#endif
#ifdef MOZ_ENABLE_GNOMEVFS
{ NS_GNOMEVFSSERVICE_CONTRACTID, &kNS_GNOMEVFSSERVICE_CID },
#endif
#ifdef MOZ_ENABLE_GIO
{ NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
{ NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID },
#endif
+ { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
{ nullptr }
};
static nsresult
InitGType ()
{
g_type_init();
return NS_OK;