Bug 977048 Make close icon work for all plugin placeholders r=mcsmurf a=Ratty SEAMONKEY_2_26b1_BUILD1
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sun, 06 Apr 2014 12:29:12 +0100
changeset 19421 362c5b3bd492b1347d1dd72d1aa3f19ea3a17f1a
parent 19420 11cfb079b026aec4dd570ad0db354f5dc5a34af0
child 19422 973d8e1b69b660ec5588573787e2f043495175db
child 19424 a063fe1b464d7c3915511fedc949c025953c6b2e
push id1108
push userneil@parkwaycc.co.uk
push dateSun, 06 Apr 2014 11:29:35 +0000
treeherdercomm-beta@362c5b3bd492 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcsmurf, Ratty
bugs977048
Bug 977048 Make close icon work for all plugin placeholders r=mcsmurf a=Ratty a=ewong for checkin to a CLOSED TREE
suite/common/bindings/notification.xml
suite/mailnews/compose/MsgComposeCommands.js
--- a/suite/common/bindings/notification.xml
+++ b/suite/common/bindings/notification.xml
@@ -1368,42 +1368,42 @@
                 this.activatePlugins(checkbox.checked);
               }).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();
+                this.hideAllPluginOverlays();
               }).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">
+      <method name="hideAllPluginOverlays">
         <body>
           <![CDATA[
             var plugins = this.contentWindowUtils.plugins;
             for (let plugin of plugins)
-              this.hideClickToPlayOverlay(plugin);
+              this.hidePluginOverlay(plugin);
           ]]>
         </body>
       </method>
 
-      <method name="hideClickToPlayOverlay">
+      <method name="hidePluginOverlay">
         <parameter name="pluginElement"/>
         <body>
           <![CDATA[
             var overlay = this.getPluginUI(pluginElement, "main");
             if (overlay) // no overlay if plugin has been activated
               overlay.classList.remove("visible");
           ]]>
         </body>
@@ -1450,19 +1450,16 @@
             overlay.classList.toggle("visible",
                                      !this.isTooSmall(pluginElement, overlay));
 
             var pluginName = this.getPluginInfo(pluginElement).pluginName;
             var messageString = this._stringBundle.formatStringFromName("PluginClickToActivate", [pluginName], 1);
             var overlayText = this.getPluginUI(pluginElement, "clickToPlay");
             overlayText.textContent = messageString;
             this.addLinkClickCallback(overlay, this.activateSinglePlugin, pluginElement);
-
-            var closeIcon = this.getPluginUI(pluginElement, "closeIcon");
-            this.addLinkClickCallback(closeIcon, this.hideClickToPlayOverlay, pluginElement);
           ]]>
         </body>
       </method>
 
       <method name="handlePlayPreviewEvent">
         <parameter name="pluginElement"/>
         <body>
           <![CDATA[
@@ -2161,16 +2158,19 @@
         <![CDATA[
           var nsIObjectLoadingContent = Components.interfaces.nsIObjectLoadingContent;
           var plugin = event.target;
           // Since we are expecting also untrusted events, make sure
           // that the target is a plugin
           if (!(plugin instanceof nsIObjectLoadingContent))
             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)) {
@@ -2700,17 +2700,17 @@
               label: this._stringBundle.GetStringFromName("activatepluginsMessage.never.label"),
               accessKey: this._stringBundle.GetStringFromName("activatepluginsMessage.never.accesskey"),
               callback: (function () {
                 this.setPermissionForPlugins(nsIPermissionManager.DENY_ACTION);
                 var notification = PopupNotifications.getNotification("click-to-play-plugins",
                                                                       this.activeBrowser);
                 if (notification)
                   notification.remove();
-                this.removeClickToPlayOverlays();
+                this.hideAllPluginOverlays();
               }).bind(this)
             }];
             var options = {
               dismissed: true,
               centerActions: centerActions
             };
             PopupNotifications.show(this.activeBrowser, "click-to-play-plugins",
                                     messageString, "plugins-notification-icon",
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -1465,17 +1465,17 @@ function GenericSendMessage( msgType )
       }
       catch (ex) {
         dump("failed to SendMsg: " + ex + "\n");
         gWindowLocked = false;
         enableEditableFields();
         updateComposeItems();
       }
       if (gMsgCompose && originalCharset != gMsgCompose.compFields.characterSet)
-        SetDocumentCharacterSet(gMsgCompose.compFields.characterSet);
+        ComposeSetCharacterSet(gMsgCompose.compFields.characterSet);
     }
   }
   else
     dump("###SendMessage Error: composeAppCore is null!\n");
 }
 
 function CheckValidEmailAddress(aTo, aCC, aBCC)
 {