Bug 860537 Some parts of click-to-play don't work if doorhangers are disabled r=Ratty a=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sun, 14 Apr 2013 23:24:06 +0100
changeset 13679 12ea7b098021d9dcf23b2d9109c807806091452e
parent 13678 90d5ca3ecce6cb0c53a330075e8b617a864883e1
child 13680 a7d94d98f7080ad96ee5ad04c2c0db814920121d
push id914
push userneil@parkwaycc.co.uk
push dateSun, 14 Apr 2013 22:25:07 +0000
treeherdercomm-aurora@aa9ab103b038 [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
@@ -1267,30 +1267,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);
@@ -2414,38 +2437,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";