Bug 620776 - Add plugin.disable UI to Preferences. r=IanN ui-r=neil
authorEdmund Wong <ewong@pw-wspx.org>
Sun, 15 Jan 2012 23:15:16 +0800
changeset 10423 600face6bd77ebf150f8176f7d9beead23ce9fab
parent 10422 069ae74f83d93204992ca0ec9aba28902091a9cb
child 10424 ff9d678c33716a97a5d8df5e1c41f45253cda5cc
push idunknown
push userunknown
push dateunknown
reviewersIanN, neil
bugs620776
Bug 620776 - Add plugin.disable UI to Preferences. r=IanN ui-r=neil
suite/browser/browser-prefs.js
suite/common/pref/pref-scripts.xul
suite/locales/en-US/chrome/common/pref/pref-scripts.dtd
suite/mailnews/prefs/mailPrefsOverlay.xul
--- a/suite/browser/browser-prefs.js
+++ b/suite/browser/browser-prefs.js
@@ -716,16 +716,17 @@ pref("dom.ipc.plugins.enabled", true);
 
 // plugin finder service url
 pref("pfs.datasource.url", "https://pfs.mozilla.org/plugins/PluginFinderService.php?mimetype=%PLUGIN_MIMETYPE%&appID=%APP_ID%&appVersion=%APP_VERSION%&clientOS=%CLIENT_OS%&chromeLocale=%CHROME_LOCALE%");
 pref("plugins.update.url", "http://www.mozilla.com/%LOCALE%/plugincheck/");
 pref("plugins.update.notifyUser", false);
 pref("plugins.hide_infobar_for_outdated_plugin", false);
 pref("plugins.hide_infobar_for_carbon_failure_plugin", false);
 pref("plugins.hide_infobar_for_missing_plugin", false);
+pref("plugin.disable", false);
 
 #ifdef XP_MACOSX
 pref("plugins.use_layers", true);
 #endif
 
 #ifndef XP_MACOSX
 // Restore the spinner that was removed in bug 481359
 pref("ui.use_activity_cursor", true);
--- a/suite/common/pref/pref-scripts.xul
+++ b/suite/common/pref/pref-scripts.xul
@@ -60,16 +60,19 @@
                   name="dom.disable_window_status_change"
                   type="bool" inverted="true"/>
       <preference id="dom.disable_image_src_set"
                   name="dom.disable_image_src_set"
                   type="bool" inverted="true"/>
       <preference id="dom.event.contextmenu.enabled"
                   name="dom.event.contextmenu.enabled"
                   type="bool"/>
+      <preference id="plugin.disable"
+                  name="plugin.disable"
+                  type="bool" inverted="true"/>
       <preference id="plugins.hide_infobar_for_missing_plugin"
                   name="plugins.hide_infobar_for_missing_plugin"
                   type="bool" inverted="true"/>
     </preferences>
 
     <groupbox id="javascriptPreferences" flex="1">
       <caption label="&enableJavaScript.label;"/>
 
@@ -100,18 +103,23 @@
                   label="&allowWindowImageSrcChange.label;"
                   preference="dom.disable_image_src_set"/>
         <listitem type="checkbox" id="allowContextmenuDisable"
                   label="&allowContextmenuDisable.label;"
                   preference="dom.event.contextmenu.enabled"/>
       </listbox>
     </groupbox>
 
-    <groupbox id="pluginPreferences" hidden="true">
+    <groupbox id="pluginPreferences">
       <caption label="&enablePlugin.label;"/>
+      <checkbox id="pluginForSuite"
+                label="&enablePluginForSuite.label;"
+                accesskey="&enablePluginForSuite.accesskey;"
+                preference="plugin.disable"/>
+
       <!-- mailnews will add its checkbox here using overlay (mailPrefsOverlay.xul).
       -->
     </groupbox>
 
     <groupbox id="pluginsNotificationPref">
       <caption label="&whenPluginsRequired.label;"/>
 
       <checkbox id="displayPluginsNotification"
--- a/suite/locales/en-US/chrome/common/pref/pref-scripts.dtd
+++ b/suite/locales/en-US/chrome/common/pref/pref-scripts.dtd
@@ -12,13 +12,15 @@
 <!ENTITY allowScripts.accesskey          "s">
 <!ENTITY allowWindowMoveResize.label     "Move or resize existing windows">
 <!ENTITY allowWindowFlip.label           "Raise or lower windows">
 <!ENTITY allowWindowStatusChange.label   "Change status bar text">
 <!ENTITY allowWindowImageSrcChange.label "Change images">
 <!ENTITY allowContextmenuDisable.label   "Disable or replace context menus">
 <!ENTITY allowHideStatusBar.label        "Hide the status bar">
 
-<!ENTITY enablePlugin.label              "Enable Plugins for">
+<!ENTITY enablePlugin.label              "Enable Plugins for:">
+<!ENTITY enablePluginForSuite.label      "Suite">
+<!ENTITY enablePluginForSuite.accesskey  "u">
 
 <!ENTITY whenPluginsRequired.label       "When additional plugins are required">
 <!ENTITY displayNotification.label       "Display a notification bar at the top of the content area">
 <!ENTITY displayNotification.accesskey   "N">
--- a/suite/mailnews/prefs/mailPrefsOverlay.xul
+++ b/suite/mailnews/prefs/mailPrefsOverlay.xul
@@ -12,23 +12,27 @@
     <preference id="general.startup.mail"
                 name="general.startup.mail"
                 type="bool"/>
     <preference id="general.startup.addressbook"
                 name="general.startup.addressbook"
                 type="bool"/>
   </preferences>
   <preferences id="scripts_preferences">
+    <preference id="plugin.disable"
+                onchange="setDisableState('pluginAllowMailNews', !this.value);"/>
     <preference id="mailnews.message_display.allow.plugins"
                 name="mailnews.message_display.allow.plugins"
                 type="bool"/>
   </preferences>
   <!-- plugin toggle for mail/news -->
-  <groupbox id="pluginPreferences" hidden="false">
+  <groupbox id="pluginPreferences">
     <checkbox id="pluginAllowMailNews"
+              class="indent"
+              onsyncfrompreference="document.getElementById('scripts_pane').setDisableState(this.id, !document.getElementById('plugin.disable').value);"
               label="&enbPluginCheckMailNews.label;"
               accesskey="&enbPluginCheckMailNews.accesskey;"
               preference="mailnews.message_display.allow.plugins"/>
   </groupbox>
 
   <!-- mail startup toggle -->
   <groupbox id="generalStartupPreferences">
     <checkbox id="generalStartupMail"