[gnome-shell/wip/cosimoc/notification-refactor] notificationDaemon: separate out GtkNotification creation



commit ee2d63f53e7ad80416c56b8ec68deb1a2fbe58d3
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Wed Oct 10 17:28:43 2018 -0700

    notificationDaemon: separate out GtkNotification creation
    
    This way, source subclasses can easily use a notification subclass
    if different functionality is required.

 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];
         });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]