Bug 1101978 Deal with removal of the plugin finder service r=Ratty a=Ratty SEAMONKEY_2_31b2_BUILD1 SEAMONKEY_2_31b2_RELEASE
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 25 Nov 2014 22:32:03 +0000
changeset 20898 919ddae9cf988aef32cfafc0dab9b79f4c558881
parent 20897 8f532035badf33818e72723a56ec9b85f86e0877
child 20899 66b85da37be9edd492b2470ee9ade48ba426d3ef
child 20901 e797cb3f6270be1020214e1ccc46067eb9158acb
push id1255
push userneil@parkwaycc.co.uk
push dateTue, 25 Nov 2014 22:33:05 +0000
treeherdercomm-beta@919ddae9cf98 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, Ratty
bugs1101978
Bug 1101978 Deal with removal of the plugin finder service r=Ratty a=Ratty CLOSED TREE
suite/common/bindings/notification.xml
--- a/suite/common/bindings/notification.xml
+++ b/suite/common/bindings/notification.xml
@@ -85,17 +85,16 @@
               .getInterface(Components.interfaces.nsIWebNavigation)
               .QueryInterface(Components.interfaces.nsILoadContext)
               .usePrivateBrowsing
       </field>
 
       <method name="onDocumentChange">
         <body>
           <![CDATA[
-            this.missingPlugins = null;
             this.crashNotified = false;
             this.clickToPlayPluginsActivated = false;
             this.clickToPlayTypes = Set();
             if (this.popupCount) {
               this.popupCount = 0;
               this.notifyPopupCountChanged();
             }
             this.removeTransientNotifications();
@@ -503,21 +502,16 @@
                   this.notifyPopupCountChanged();
                 }
                 break;
             }
           ]]>
         </body>
       </method>
 
-      <field name="_missingPlugins">null</field>
-      <property name="missingPlugins"
-                onget="return this._missingPlugins || (this._missingPlugins = new Map());"
-                onset="return this._missingPlugins = val;"/>
-
       <field name="CrashSubmit">null</field>
 
       <field name="crashNotified">false</field>
 
       <field name="clickToPlayPluginsActivated">false</field>
 
       <field name="clickToPlayTypes">Set()</field>
 
@@ -567,20 +561,16 @@
       <method name="pluginUnavailable">
         <parameter name="aPlugin"/>
         <parameter name="aNotification"/>
         <parameter name="aMessage"/>
         <parameter name="aButtons"/>
         <parameter name="aPref"/>
         <body>
           <![CDATA[
-            // Save information on the plugin to give to the plugin finder.
-            var pluginInfo = this.getPluginInfo(aPlugin);
-            this.missingPlugins.set(pluginInfo.mimetype, pluginInfo);
-
             // Show the in-content UI if it's not too big. The crashed plugin handler already does this.
             var overlay = this.getPluginUI(aPlugin, "main");
             aPlugin.addEventListener("overflow", this);
             aPlugin.addEventListener("underflow", this);
             overlay.classList.toggle("visible",
                                      !this.isTooSmall(aPlugin, overlay));
 
             if (this._prefs.getBoolPref(aPref || "plugins.hide_infobar_for_missing_plugin"))
@@ -1001,26 +991,16 @@
                 if (iframe)
                   iframe.remove();
                 break;
             }
           ]]>
         </body>
       </method>
 
-      <method name="installMissingPlugins">
-        <body>
-          <![CDATA[
-            window.openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
-                              "", "chrome,centerscreen,resizable=yes",
-                              {plugins: this.missingPlugins, browser: this.activeBrowser});
-          ]]>
-        </body>
-      </method>
-
       <method name="playSoundForBlockedPopup">
         <body>
           <![CDATA[
             const kCustomSound = 1;
             var playSound = this._prefs.getBoolPref("privacy.popups.sound_enabled");
 
             if (playSound) {
               var sound = Components.classes["@mozilla.org/sound;1"]
@@ -2158,38 +2138,29 @@
             return;
 
           var closeIcon = this.getPluginUI(plugin, "closeIcon");
           this.addLinkClickCallback(closeIcon, this.hidePluginOverlay, plugin);
 
           var notification, message, buttons, pref;
           switch (plugin.pluginFallbackType) {
             case nsIObjectLoadingContent.PLUGIN_UNSUPPORTED:
-              // For broken non-object plugin tags, register a click handler so
-              // that the user can click the plugin replacement to get the new
-              // plugin. Object tags can, and often do, deal with that
-              // themselves, so don't stomp on the page developer's toes.
-              if (!(plugin instanceof HTMLObjectElement)) {
-                // We don't yet check to see if there's actually an installer available.
-                var installStatus = this.getPluginUI(plugin, "installStatus");
-                installStatus.setAttribute("status", "ready");
-                var iconStatus = this.getPluginUI(plugin, "icon");
-                iconStatus.setAttribute("status", "ready");
-                var installLink = this.getPluginUI(plugin, "installPluginLink");
-                this.addLinkClickCallback(installLink, installMissingPlugins);
-              }
-
               notification = "missing-plugins";
               message = this._stringBundle.GetStringFromName("missingpluginsMessage.title");
-              buttons = [{
-                label: this._stringBundle.GetStringFromName("missingpluginsMessage.button.label"),
-                accessKey: this._stringBundle.GetStringFromName("missingpluginsMessage.button.accesskey"),
-                popup: null,
-                callback: this.installMissingPlugins.bind(this)
-              }];
+              if ("goPreferences" in window) {
+                buttons = [{
+                  label: this._stringBundle.GetStringFromName("popupWarningButton"),
+                  accessKey: this._stringBundle.GetStringFromName("popupWarningButton.accesskey"),
+                  popup: null,
+                  callback: function() {
+                    goPreferences("scripts_pane");
+                    return true;
+                  }
+                }];
+              }
               break;
 
             case nsIObjectLoadingContent.PLUGIN_DISABLED:
               if (!this.canActivatePlugin(plugin, true))
                 return;
 
               notification = "disabled-plugins";
               message = this._stringBundle.GetStringFromName("missingpluginsMessage.title");
@@ -2211,21 +2182,16 @@
             case nsIObjectLoadingContent.PLUGIN_BLOCKLISTED:
               notification = "blocked-plugins";
               message = this._stringBundle.GetStringFromName("blockedpluginsMessage.title");
               buttons = [{
                 label: this._stringBundle.GetStringFromName("blockedpluginsMessage.infoButton.label"),
                 accessKey: this._stringBundle.GetStringFromName("blockedpluginsMessage.infoButton.accesskey"),
                 popup: null,
                 callback: this.openURLPref.bind(this, "extensions.blocklist.detailsURL")
-              }, {
-                label: this._stringBundle.GetStringFromName("blockedpluginsMessage.searchButton.label"),
-                accessKey: this._stringBundle.GetStringFromName("blockedpluginsMessage.searchButton.accesskey"),
-                popup: null,
-                callback: this.installMissingPlugins.bind(this)
               }];
               break;
 
             case nsIObjectLoadingContent.PLUGIN_OUTDATED:
               notification = "outdated-plugins";
               message = this._stringBundle.GetStringFromName("outdatedpluginsMessage.title");
               buttons = [{
                 label: this._stringBundle.GetStringFromName("outdatedpluginsMessage.button.label"),
@@ -2439,30 +2405,16 @@
             popup: null,
             callback: callback
           }];
 
           this.pluginUnavailable(plugin, notification, message, buttons, pref);
         ]]>
       </handler>
 
-      <handler event="NewPluginInstalled" phase="capturing">
-        <![CDATA[
-          this.missingPlugins = null;
-
-          // clean up the UI after a new plugin has been installed.
-          var notification = this.getNotificationWithValue("missing-plugins");
-          if (notification)
-            this.removeNotification(notification);
-
-          // reload the browser to make the new plugin show.
-          this.activeBrowser.reload();
-        ]]>
-      </handler>
-
       <handler event="MozApplicationManifest" phase="capturing">
         <![CDATA[
           if (!this._prefs.getBoolPref("browser.offline-apps.notify"))
             return;
 
           try {
             if (this._prefs.getBoolPref("offline-apps.allow_by_default"))
               return;