From 80a75471291c39000e858970f9327b02a0060658 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 10 Oct 2018 17:28:43 -0700 Subject: [PATCH] notificationDaemon: separate out GtkNotification creation This way, source subclasses can easily use a notification subclass if different functionality is required. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/258 --- js/ui/notificationDaemon.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 81d3e3ae3..4d2be44ed 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -660,6 +660,10 @@ var GtkNotificationDaemonAppSource = new Lang.Class({ return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath, callback); }, + _createNotification(params) { + return new GtkNotificationDaemonNotification(this, params); + }, + activateAction(actionId, target) { this._createApp((app, error) => { if (error == null) @@ -688,7 +692,7 @@ var GtkNotificationDaemonAppSource = new Lang.Class({ if (this._notifications[notificationId]) this._notifications[notificationId].destroy(); - let notification = new GtkNotificationDaemonNotification(this, notificationParams); + let notification = this._createNotification(notificationParams); notification.connect('destroy', () => { delete this._notifications[notificationId]; });