Bug 743312 Followup for when doorhangers have been disabled r=InvisibleSmiley
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 18 Apr 2012 23:49:46 +0100
changeset 11663 78c57aba3724c82ad68ecfb711f9d74e7d41b02b
parent 11662 e1487fbcabfe010adf680052633d52b70c50765a
child 11664 b03573ab65f82183882b7fbe33fa22aedd05a134
push idunknown
push userunknown
push dateunknown
reviewersInvisibleSmiley
bugs743312
Bug 743312 Followup for when doorhangers have been disabled r=InvisibleSmiley
suite/common/bindings/notification.xml
--- a/suite/common/bindings/notification.xml
+++ b/suite/common/bindings/notification.xml
@@ -451,20 +451,16 @@
               if (!objLoadingContent.activated)
                 objLoadingContent.playPlugin();
             }
             this.removePluginClickToPlayPrompt();
           ]]>
         </body>
       </method>
 
-      <method name="showPluginClickToPlayPrompt"/>
-
-      <method name="removePluginClickToPlayPrompt"/>
-
       <method name="openURLPref">
         <parameter name="aPref"/>
         <body>
           <![CDATA[
             var url = this._urlFormatter.formatURLPref(aPref);
             var nsIBrowserDOMWindow = Components.interfaces.nsIBrowserDOMWindow;
 
             var browserWin;
@@ -968,16 +964,44 @@
                                                null,this.PRIORITY_INFO_MEDIUM,
                                               buttons);
             box.persistence = 1;
             box.timeout = Date.now() + 20000; // 20 seconds
           ]]>
         </body>
       </method>
 
+      <method name="removePluginClickToPlayPrompt">
+        <body>
+          <![CDATA[
+            var notification = this.getNotificationWithValue("click-to-play-plugins");
+            if (notification)
+              this.removeNotification(notification);
+          ]]>
+        </body>
+      </method>
+
+      <method name="showPluginClickToPlayPrompt">
+        <body>
+          <![CDATA[
+            this.clickToPlayPromptShown = true;
+            var messageString = this._stringBundle.GetStringFromName("activatePluginsMessage.message");
+            var buttons = [{
+              label: this._stringBundle.GetStringFromName("activatePluginsMessage.label"),
+              accessKey: this._stringBundle.GetStringFromName("activatePluginsMessage.accesskey"),
+              callback: this.activatePlugins.bind(this)
+            }];
+            this.appendNotification(messageString, "click-to-play-plugins",
+                                    "chrome://mozapps/skin/plugins/pluginGeneric.png",
+                                    this.PRIORITY_INFO_HIGH,
+                                    buttons);
+          ]]>
+        </body>
+      </method>
+
       <method name="showGeolocationPrompt">
         <parameter name="file"/>
         <parameter name="site"/>
         <parameter name="image"/>
         <parameter name="allowCallback"/>
         <parameter name="cancelCallback"/>
         <body>
           <![CDATA[