Bug 747186 - Port |Bug 711618 - implement basic click to play permission model| to Data Manager. r=KaiRo
authorJens Hatlak <jh@junetz.de>
Sun, 22 Apr 2012 11:15:00 -0400
changeset 11989 edf201d1de4bf8bb5867a9c0c128177a9586081d
parent 11988 5d2d6c4d3dbc0fa39fbb64e2eac1b5ee3b89474d
child 11990 def8ce3a54c275bf1df7df3f220311a209166ac8
push id599
push usermconley@mozilla.com
push dateMon, 16 Jul 2012 20:33:12 +0000
treeherdercomm-beta@c3489d5b7b65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersKaiRo
bugs747186, 711618
Bug 747186 - Port |Bug 711618 - implement basic click to play permission model| to Data Manager. r=KaiRo
suite/common/dataman/dataman.js
suite/locales/en-US/chrome/common/dataman/dataman.properties
--- a/suite/common/dataman/dataman.js
+++ b/suite/common/dataman/dataman.js
@@ -1255,17 +1255,18 @@ var gPerms = {
   addButtonClick: function permissions_addButtonClick() {
     gDataman.debugMsg("Add permissions button clicked!");
     // this.addSelBox, this.addHost, this.addType, this.addButton
     if (this.addSelBox.hidden) {
       // Show addition box, disable button.
       this.addButton.disabled = true;
       this.addType.removeAllItems(); // Make sure list is clean.
       let permTypes = ["allowXULXBL", "cookie", "geo", "image", "install",
-                       "object", "password", "popup", "script", "stylesheet"];
+                       "object", "password", "plugins", "popup", "script",
+                       "stylesheet"];
       for (let i = 0; i < permTypes.length; i++) {
         let typeDesc = permTypes[i];
         try {
           typeDesc = gDataman.bundle.getString("perm." + permTypes[i] + ".label");
         }
         catch (e) {
         }
         let menuitem = this.addType.appendItem(typeDesc, permTypes[i]);
@@ -1311,16 +1312,20 @@ var gPerms = {
       case "geo":
         return Services.perms.DENY_ACTION;
       case "install":
         if (Services.prefs.getBoolPref("xpinstall.whitelist.required"))
           return Services.perms.DENY_ACTION;
         return Services.perms.ALLOW_ACTION;
       case "password":
         return Services.perms.ALLOW_ACTION;
+      case "plugins":
+        if (Services.prefs.getBoolPref("plugins.click_to_play"))
+          return Services.perms.UNKNOWN_ACTION;
+        return Services.perms.ALLOW_ACTION;
       case "popup":
         if (Services.prefs.getBoolPref("dom.disable_open_during_load"))
           return Services.perms.DENY_ACTION;
         return Services.perms.ALLOW_ACTION;
     }
     try {
       // Look for an nsContentBlocker permission
       switch (Services.prefs.getIntPref("permissions.default." + aType)) {
--- a/suite/locales/en-US/chrome/common/dataman/dataman.properties
+++ b/suite/locales/en-US/chrome/common/dataman/dataman.properties
@@ -50,16 +50,17 @@ cookies.deleteSelectedYes=&Remove
 # permissions
 perm.allowXULXBL.label=Use XUL/XBL Markup
 perm.cookie.label=Set Cookies
 perm.geo.label=Share Location
 perm.image.label=Load Images
 perm.install.label=Install Add-ons
 perm.object.label=Run Plugins
 perm.password.label=Save Passwords
+perm.plugins.label=Activate Plugins
 perm.popup.label=Open Popup Windows
 perm.script.label=Run Scripts
 perm.stylesheet.label=Load Stylesheets
 
 perm.type.default=Select a type
 
 # passwords
 pwd.hidePasswords=Hide Passwords