browser/components/preferences/aboutPermissions.js
changeset 238736 1dd7cc876cd1c6497c699929ed401fce4a0c072b
parent 221906 9096b9b4aa73d58742e88ced38f1d2018464f295
child 238739 f75774fac6e2df9e9b673878514e9f94caa8953d
--- a/browser/components/preferences/aboutPermissions.js
+++ b/browser/components/preferences/aboutPermissions.js
@@ -331,17 +331,26 @@ let PermissionDefaults = {
       return this.DENY;
     }
     return this.UNKNOWN;
   },
   set fullscreen(aValue) {
     let value = (aValue != this.DENY);
     Services.prefs.setBoolPref("full-screen-api.enabled", value);
   },
-
+  get push() {
+    if (!Services.prefs.getBoolPref("dom.push.enabled")) {
+      return this.DENY;
+    }
+    return this.UNKNOWN;
+  },
+  set push(aValue) {
+    let value = (aValue != this.DENY);
+    Services.prefs.setBoolPref("dom.push.enabled", value);
+  },
   get camera() this.UNKNOWN,
   get microphone() this.UNKNOWN
 };
 
 /**
  * AboutPermissions manages the about:permissions page.
  */
 let AboutPermissions = {
@@ -373,22 +382,22 @@ let AboutPermissions = {
   /**
    * This reflects the permissions that we expose in the UI. These correspond
    * to permission type strings in the permission manager, PermissionDefaults,
    * and element ids in aboutPermissions.xul.
    *
    * Potential future additions: "sts/use", "sts/subd"
    */
   _supportedPermissions: ["password", "cookie", "geo", "indexedDB", "popup",
-                          "fullscreen", "camera", "microphone"],
+                          "fullscreen", "camera", "microphone", "push"],
 
   /**
    * Permissions that don't have a global "Allow" option.
    */
-  _noGlobalAllow: ["geo", "indexedDB", "fullscreen", "camera", "microphone"],
+  _noGlobalAllow: ["geo", "indexedDB", "fullscreen", "camera", "microphone", "push"],
 
   /**
    * Permissions that don't have a global "Deny" option.
    */
   _noGlobalDeny: ["camera", "microphone"],
 
   _stringBundle: Services.strings.
                  createBundle("chrome://browser/locale/preferences/aboutPermissions.properties"),
@@ -406,16 +415,17 @@ let AboutPermissions = {
 
     // Attach observers in case data changes while the page is open.
     Services.prefs.addObserver("signon.rememberSignons", this, false);
     Services.prefs.addObserver("network.cookie.", this, false);
     Services.prefs.addObserver("geo.enabled", this, false);
     Services.prefs.addObserver("dom.indexedDB.enabled", this, false);
     Services.prefs.addObserver("dom.disable_open_during_load", this, false);
     Services.prefs.addObserver("full-screen-api.enabled", this, false);
+    Services.prefs.addObserver("dom.push.enabled", this, false);
 
     Services.obs.addObserver(this, "perm-changed", false);
     Services.obs.addObserver(this, "passwordmgr-storage-changed", false);
     Services.obs.addObserver(this, "cookie-changed", false);
     Services.obs.addObserver(this, "browser:purge-domain-data", false);
 
     this._observersInitialized = true;
     Services.obs.notifyObservers(null, "browser-permissions-preinit", null);
@@ -427,16 +437,17 @@ let AboutPermissions = {
   cleanUp: function() {
     if (this._observersInitialized) {
       Services.prefs.removeObserver("signon.rememberSignons", this, false);
       Services.prefs.removeObserver("network.cookie.", this, false);
       Services.prefs.removeObserver("geo.enabled", this, false);
       Services.prefs.removeObserver("dom.indexedDB.enabled", this, false);
       Services.prefs.removeObserver("dom.disable_open_during_load", this, false);
       Services.prefs.removeObserver("full-screen-api.enabled", this, false);
+      Services.prefs.removeObserver("dom.push.enabled", this, false);
 
       Services.obs.removeObserver(this, "perm-changed");
       Services.obs.removeObserver(this, "passwordmgr-storage-changed");
       Services.obs.removeObserver(this, "cookie-changed");
       Services.obs.removeObserver(this, "browser:purge-domain-data");
     }
 
     gSitesStmt.finalize();