Bug 860537 Some parts of click-to-play don't work if doorhangers are disabled r=Ratty a=IanN SEAMONKEY_2_18b2_BUILD1 SEAMONKEY_2_18b2_RELEASE
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sun, 14 Apr 2013 23:24:06 +0100
changeset 14996 4a28b1a7bb7d7c66f8035c841a0cb904dd85c798
parent 14995 aa541a194882863fe54b53a6c27e4ccd4cd3f112
child 14997 776761804a3610ac24e92758588155f0c2768b1f
child 14999 60638c26d64525ae4aafb7a03f7e8e11520bedb4
push id881
push userneil@parkwaycc.co.uk
push dateSun, 14 Apr 2013 22:26:31 +0000
treeherdercomm-beta@4a28b1a7bb7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, IanN
bugs860537
Bug 860537 Some parts of click-to-play don't work if doorhangers are disabled r=Ratty a=IanN
suite/common/bindings/notification.xml
--- a/suite/common/bindings/notification.xml
+++ b/suite/common/bindings/notification.xml
@@ -1224,30 +1224,53 @@
                 this.activatePlugins();
               }).bind(this)
             }, {
               label: this._stringBundle.GetStringFromName("activatepluginsMessage.dismiss.label"),
               accessKey: this._stringBundle.GetStringFromName("activatepluginsMessage.dismiss.accesskey"),
               callback: (function () {
                 if (checkbox.checked)
                   this.setPermissionForPlugins(nsIPermissionManager.DENY_ACTION);
+                this.removeClickToPlayOverlays();
               }).bind(this)
             }];
             var box = this.appendNotification(messageString,
                                               "click-to-play-plugins",
                                               null,
                                               this.PRIORITY_INFO_HIGH,
                                               buttons);
             // Force a style flush, so that we ensure the binding is attached.
             box.clientTop;
             box.appendChild(checkbox);
           ]]>
         </body>
       </method>
 
+      <method name="removeClickToPlayOverlays">
+        <body>
+          <![CDATA[
+            var plugins = this.contentWindowUtils.plugins;
+            for (let plugin of plugins)
+              this.hideClickToPlayOverlay(plugin);
+          ]]>
+        </body>
+      </method>
+
+      <method name="hideClickToPlayOverlay">
+        <parameter name="pluginElement"/>
+        <body>
+          <![CDATA[
+            var doc = pluginElement.ownerDocument;
+            var overlay = doc.getAnonymousElementByAttribute(pluginElement, "class", "mainBox");
+            if (overlay) // no overlay if plugin has been activated
+              overlay.style.visibility = "hidden";
+          ]]>
+        </body>
+      </method>
+
       <method name="setupPluginClickToPlay">
         <parameter name="pluginElement"/>
         <body>
           <![CDATA[
             var doc = pluginElement.ownerDocument;
             var overlay = doc.getAnonymousElementByAttribute(pluginElement, "class", "mainBox");
 
             var objLoadingContent = pluginElement.QueryInterface(Components.interfaces.nsIObjectLoadingContent);
@@ -2371,38 +2394,16 @@
             };
             PopupNotifications.show(this.activeBrowser, "click-to-play-plugins",
                                     messageString, "plugins-notification-icon",
                                     mainAction, secondaryActions, options);
            ]]>
         </body>
       </method>
 
-      <method name="removeClickToPlayOverlays">
-        <body>
-          <![CDATA[
-            var plugins = this.contentWindowUtils.plugins;
-            for (let plugin of plugins)
-              this.hideClickToPlayOverlay(plugin);
-          ]]>
-        </body>
-      </method>
-
-      <method name="hideClickToPlayOverlay">
-        <parameter name="pluginElement"/>
-        <body>
-          <![CDATA[
-            var doc = pluginElement.ownerDocument;
-            var overlay = doc.getAnonymousElementByAttribute(pluginElement, "class", "mainBox");
-            if (overlay) // no overlay if plugin has been activated
-              overlay.style.visibility = "hidden";
-          ]]>
-        </body>
-      </method>
-
       <method name="showGeolocationPrompt">
         <parameter name="file"/>
         <parameter name="site"/>
         <parameter name="allowCallback"/>
         <parameter name="cancelCallback"/>
         <body>
           <![CDATA[
             var type = "geolocation";