Bug 1226742 Open permissions from the notification settings menu r=Ratty a=Ratty for SeaMonkey 2.41 comm-beta
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 10 Dec 2015 00:41:27 +0000
changeset 26554 6e294a71e9645aa3b687911090d55f91a4dec135
parent 26553 f207d469868f494eac5ef3b552def598b1b83f60
child 26555 d108efa34154faeb8be46f8400898381085aacd7
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, Ratty
bugs1226742
Bug 1226742 Open permissions from the notification settings menu r=Ratty a=Ratty for SeaMonkey 2.41 comm-beta
suite/common/src/nsSuiteGlue.js
--- a/suite/common/src/nsSuiteGlue.js
+++ b/suite/common/src/nsSuiteGlue.js
@@ -246,16 +246,22 @@ SuiteGlue.prototype = {
         var ss = Services.search;
         if (ss.currentEngine.name == ss.defaultEngine.name)
           return;
         if (data == "engine-current")
           ss.defaultEngine = ss.currentEngine;
         else
           ss.currentEngine = ss.defaultEngine;
         break;
+      case "notifications-open-settings":
+        // Since this is a web notification, there's probably a browser window.
+        var mostRecentBrowserWindow = Services.wm.getMostRecentWindow("navigator:browser");
+        if (mostRecentBrowserWindow)
+          mostRecentBrowserWindow.toDataManager("|permissions");
+        break;
       case "timer-callback":
         // Load the Login Manager data from disk off the main thread, some time
         // after startup.  If the data is required before the timeout, for example
         // because a restored page contains a password field, it will be loaded on
         // the main thread, and this initialization request will be ignored.
         Services.logins;
         break;
     }
@@ -311,16 +317,17 @@ SuiteGlue.prototype = {
     Services.obs.addObserver(this, "weave:service:ready", true);
     Services.obs.addObserver(this, "weave:engine:clients:display-uri", true);
     Services.obs.addObserver(this, "session-save", true);
     Services.obs.addObserver(this, "dl-done", true);
     Services.obs.addObserver(this, "places-init-complete", true);
     Services.obs.addObserver(this, "places-database-locked", true);
     Services.obs.addObserver(this, "places-shutdown", true);
     Services.obs.addObserver(this, "browser-search-engine-modified", true);
+    Services.obs.addObserver(this, "notifications-open-settings", true);
     Services.prefs.addObserver("devtools.debugger.", this, true);
     Components.classes['@mozilla.org/docloaderservice;1']
               .getService(Components.interfaces.nsIWebProgress)
               .addProgressListener(this, Components.interfaces.nsIWebProgress.NOTIFY_LOCATION);
   },
 
   // profile is available
   _onProfileAfterChange: function()