Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / toolkit / mozapps / extensions / content / extensions.xml
blobe5d69fdadc3556a6255252277729aa625ec0f498
1 <?xml version="1.0"?>
3 # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
4 # ***** BEGIN LICENSE BLOCK *****
5 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
7 # The contents of this file are subject to the Mozilla Public License Version
8 # 1.1 (the "License"); you may not use this file except in compliance with
9 # the License. You may obtain a copy of the License at
10 # http://www.mozilla.org/MPL/
12 # Software distributed under the License is distributed on an "AS IS" basis,
13 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 # for the specific language governing rights and limitations under the
15 # License.
17 # The Original Code is The Extension Manager.
19 # The Initial Developer of the Original Code is
20 # Ben Goodger.
21 # Portions created by the Initial Developer are Copyright (C) 2004
22 # the Initial Developer. All Rights Reserved.
24 # Contributor(s):
25 #   Ben Goodger <ben@bengoodger.com>
26 #   Doron Rosenberg <doronr@us.ibm.com>
27 #   Robert Strong <robert.bugzilla@gmail.com>
29 # Alternatively, the contents of this file may be used under the terms of
30 # either the GNU General Public License Version 2 or later (the "GPL"), or
31 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 # in which case the provisions of the GPL or the LGPL are applicable instead
33 # of those above. If you wish to allow use of your version of this file only
34 # under the terms of either the GPL or the LGPL, and not to allow others to
35 # use your version of this file under the terms of the MPL, indicate your
36 # decision by deleting the provisions above and replace them with the notice
37 # and other provisions required by the GPL or the LGPL. If you do not delete
38 # the provisions above, a recipient may use your version of this file under
39 # the terms of any one of the MPL, the GPL or the LGPL.
41 # ***** END LICENSE BLOCK *****
44 <!DOCTYPE bindings [
45   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
46   <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
47   <!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd" >
48   %brandDTD;
49   %globalDTD;
50   %extensionsDTD;
53 <bindings id="addonBindings"
54           xmlns="http://www.mozilla.org/xbl"
55           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
56           xmlns:xbl="http://www.mozilla.org/xbl">
58   <binding id="addons" extends="chrome://global/content/bindings/richlistbox.xml#richlistbox">
59     <implementation>
60       <field name="_addonStrings">
61         document.getElementById("extensionsStrings");
62       </field>
64       <field name="_brandShortName">null</field>
65       <method name="getBrandShortName">
66         <body>
67           if (!this._brandShortName)
68             this._brandShortName = document.getElementById("brandStrings").getString("brandShortName");
69           return this._brandShortName;
70         </body>
71       </method>
73       <field name="_appVersion">null</field>
74       <method name="getAppVersion">
75         <body>
76           if (!this._appVersion) {
77             var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
78                                     .getService(Components.interfaces.nsIXULAppInfo)
79                                     .QueryInterface(Components.interfaces.nsIXULRuntime);
80             this._appVersion = appInfo.version;
81           }
82           return this._appVersion;
83         </body>
84       </method>
85     </implementation>
86   </binding>
88   <binding id="addon-base" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
89     <resources>
90       <stylesheet src="chrome://mozapps/skin/extensions/extensions.css"/>
91     </resources>
93     <implementation>
94       <field name="eventPrefix">"extension-"</field>
95       <property name="type" onget="return parseInt(this.getAttribute('type'));"/>
96       <property name="isCompatible" onget="return this.getAttribute('compatible') == 'true';"/>
97       <property name="isBlocklisted" onget="return this.getAttribute('blocklisted') == 'true';"/>
98       <property name="isSoftBlocklisted" onget="return this.getAttribute('blocklistedsoft') == 'true';"/>
99       <property name="isDisabled" onget="return this.getAttribute('isDisabled') == 'true';"/>
100       <property name="providesUpdatesSecurely" onget="return this.getAttribute('providesUpdatesSecurely') == 'true';"/>
101       <property name="satisfiesDependencies" onget="return this.getAttribute('satisfiesDependencies') == 'true';"/>
102       <property name="opType">
103         <getter>
104           <![CDATA[
105             var opType = this.getAttribute('opType');
106             return opType == 'none' ? null : opType;
107           ]]>
108         </getter>
109       </property>
111       <method name="fireEvent">
112         <parameter name="aEventType"/>
113         <body>
114           var e = document.createEvent("Events");
115           e.initEvent(this.eventPrefix + aEventType, true, true);
116           this.dispatchEvent(e);
117         </body>
118       </method>
119     </implementation>
121     <handlers>
122       <handler event="DOMMenuItemActive">
123         // only ensureElementIsVisible if it wasn't selected
124         if (this.parentNode.getAttribute("last-selected") != this.getAttribute("id"))
125           this.parentNode.ensureElementIsVisible(this);
126       </handler>
127     </handlers>
128   </binding>
130   <binding id="addon" extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
131     <content>
132       <xul:hbox flex="1">
133         <xul:vbox class="addon-icon" xbl:inherits="iconURL"/>
134         <xul:vbox flex="1" class="addonTextBox">
135           <xul:hbox class="addon-name-version" xbl:inherits="name, version"/>
136           <xul:hbox anonid="addonDescription" class="addon-description" xbl:inherits="description, opType"/>
137           <xul:vbox anonid="addonSelectedStatusMsgs" class="selectedStatusMsgs">
138             <xul:hbox flex="1" class="blocklistedBox attention" align="center">
139               <xul:label class="blocklistedLabel" value="&blocklisted.label;" crop="end"/>
140               <xul:label class="softBlocklistedLabel" value="&softBlocklisted.label;" crop="end"/>
141               <xul:label anonid="blocklistMoreInfo" class="text-link" value="&moreInfo.label;"
142                          onclick="if (event.button == 0) { openURL(this.getAttribute('moreInfoURL')); }" />
143             </xul:hbox>
144           </xul:vbox>
145         </xul:vbox>
146       </xul:hbox>
147     </content>
148     <implementation implements="nsIAccessibleProvider, nsIDOMXULSelectControlItemElement">
149       <constructor>
150         <![CDATA[
151           if (this.isBlocklisted || this.isSoftBlocklisted) {
152             try {
153               var blocklistMoreInfo = document.getAnonymousElementByAttribute(this, "anonid", "blocklistMoreInfo");
154               var prefs = Components.classes["@mozilla.org/preferences-service;1"]
155                                     .getService(Components.interfaces.nsIPrefBranch);
156               var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
157                                         .getService(Components.interfaces.nsIURLFormatter);
158               var url = formatter.formatURLPref("extensions.blocklist.detailsURL");
159               blocklistMoreInfo.setAttribute("moreInfoURL", url);
160             } catch(e) {
161               blocklistMoreInfo.hidden = true;
162             }
163           }
164         ]]>
165       </constructor>
167       <field name="_addonDescription">
168         document.getAnonymousElementByAttribute(this, "anonid", "addonDescription");
169       </field>
171       <property name="label" readonly="true">
172         <getter>
173           <![CDATA[
174             var labelPieces = [];
176             // Add name and version
177             labelPieces.push(this.getAttribute("name"));
178             labelPieces.push(this.getAttribute("version"));
180             // Add description
181             var description = this.getAttribute("description");
182             labelPieces.push(description);
184             // Add status message, if any
185             // description is always in this.getAttribute("description"), but
186             // description is also sometimes in anonNodes[0].value.  But other
187             // times (like when there's an actual status message) the binding
188             // of that hbox gets changed dynamically so anonNodes[0].value
189             // is the status message.  The easiest way to sort it out is
190             // to check for duplicate strings.
191             // xxxpilgrim There is some additional weirdness here.  Visually,
192             // the description is not displayed on non-selected items if
193             // the item contains a status message.  However, when you arrow
194             // up and down through the list selecting different items, we want
195             // the accessible name during the OBJ_FOCUS event to include both
196             // the description and the status message.  You would think this
197             // would be handled automatically because the binding changes
198             // (to "addon-selected", below) when the item gets selected.
199             // However, when the OBJ_FOCUS event occurs, the binding hasn't
200             // changed yet, so this property gets queried for the accessible name.
201             // Bottom line, we need to this property in the first place to
202             // ensure that items have any accessible name at all when you
203             // arrow through the list (bug 352388), _and_ we need to include
204             // both the description and the status message to make the
205             // accessible name you get during the OBJ_FOCUS event match the
206             // accessible name you would get if you queried the object
207             // after it was already focused (i.e. after the binding had
208             // changed to "addon-selected").
209             var anonNodes = document.getAnonymousNodes(this._addonDescription);
210             if (anonNodes) {
211               var statusMessage = anonNodes[0].value;
212               if (description != statusMessage)
213                 labelPieces.push(statusMessage);
214             }
215             return labelPieces.join(" ");
216           ]]>
217         </getter>
218       </property>
219     </implementation>
220   </binding>
222   <binding id="addon-selected" extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
223     <content>
224       <xul:hbox flex="1">
225         <xul:vbox class="addon-icon" xbl:inherits="iconURL"/>
226         <xul:vbox flex="1" class="addonTextBox">
227           <xul:hbox anonid="addonNameVersion" class="addon-name-version" xbl:inherits="name, version"/>
228           <xul:label anonid="addonDescriptionWrap" class="descriptionWrap" xbl:inherits="xbl:text=description"/>
229           <xul:vbox anonid="addonSelectedStatusMsgs" class="selectedStatusMsgs">
230             <xul:hbox anonid="addonOpType" class="addon-optype attention" align="center" xbl:inherits="newVersion"/>
231             <xul:hbox flex="1" class="updateAvailableBox attention">
232               <xul:label xbl:inherits="value=updateAvailableMsg" crop="end"/>
233             </xul:hbox>
234             <xul:hbox flex="1" class="incompatibleBox attention">
235               <xul:label anonid="incompatibleLabel" crop="end"/>
236             </xul:hbox>
237             <xul:hbox flex="1" class="insecureUpdateBox attention">
238               <xul:label value="&insecureUpdate.label;" crop="end"/>
239             </xul:hbox>
240             <xul:hbox flex="1" class="needsDependenciesBox attention">
241               <xul:label value="&needsDependencies.label;" crop="end"/>
242             </xul:hbox>
243             <xul:hbox flex="1" class="blocklistedBox attention" align="center">
244               <xul:label class="blocklistedLabel" value="&blocklisted.label;" crop="end"/>
245               <xul:label class="softBlocklistedLabel" value="&softBlocklisted.label;" crop="end"/>
246               <xul:label anonid="blocklistMoreInfo" class="text-link" value="&moreInfo.label;"
247                          onclick="if (event.button == 0) { openURL(this.getAttribute('moreInfoURL')); }" />
248             </xul:hbox>
249           </xul:vbox>
250           <xul:hbox anonid="selectedButtons" flex="1" class="selectedButtons">
251             <xul:button class="uninstallHide optionsButton"
252 #ifdef XP_WIN
253               label="&cmd.options.label;" accesskey="&cmd.options.accesskey;"
254               tooltiptext="&cmd.options.tooltip;"
255 #else
256               label="&cmd.optionsUnix.label;" accesskey="&cmd.optionsUnix.accesskey;"
257               tooltiptext="&cmd.optionsUnix.tooltip;"
258 #endif
259               command="cmd_options"/>
260             <xul:button class="uninstallHide themeButton useThemeButton" label="&cmd.useTheme.label;"
261                         accesskey="&cmd.useTheme.accesskey;" tooltiptext="&cmd.useTheme.tooltip;"
262                         command="cmd_useTheme"/>
263             <xul:spacer flex="1"/>
264             <xul:button class="disableShow enableHide uninstallHide enableButton" label="&cmd.enable.label;"
265                         accesskey="&cmd.enable.accesskey;" tooltiptext="&cmd.enable.tooltip;"
266                         command="cmd_enable"/>
267             <xul:button class="enableShow disableHide uninstallHide disableButton" label="&cmd.disable.label;"
268                         accesskey="&cmd.disable.accesskey;" tooltiptext="&cmd.disable.tooltip;"
269                         command="cmd_disable"/>
270             <xul:button class="uninstallHide uninstallButton" label="&cmd.uninstall.label;"
271                         accesskey="&cmd.uninstall2.accesskey;" tooltiptext="&cmd.uninstall2.tooltip;"
272                         command="cmd_uninstall"/>
273             <xul:button class="uninstallShow cancelUninstallButton" label="&cancel.label;"
274                         accesskey="&cancel.accesskey;" tooltiptext="&cmd.cancelUninstall.tooltip;"
275                         command="cmd_cancelUninstall"/>
276             <xul:button class="installShow cancelInstallButton" label="&cancelInstall.label;"
277                         accesskey="&cancelInstall.accesskey;" tooltiptext="&cmd.cancelInstall.tooltip;"
278                         command="cmd_cancelInstall"/>
279             <xul:button class="upgradeShow cancelUpgradeButton" label="&cancelUpgrade.label;"
280                         accesskey="&cancelUpgrade.accesskey;" tooltiptext="&cmd.cancelUpgrade.tooltip;"
281                         command="cmd_cancelUpgrade"/>
282           </xul:hbox>
283         </xul:vbox>
284       </xul:hbox>
285     </content>
287     <implementation implements="nsIAccessibleProvider, nsIDOMXULSelectControlItemElement">
288       <constructor>
289         <![CDATA[
290           if (this.isBlocklisted || this.isSoftBlocklisted) {
291             try {
292               var blocklistMoreInfo = document.getAnonymousElementByAttribute(this, "anonid", "blocklistMoreInfo");
293               var prefs = Components.classes["@mozilla.org/preferences-service;1"]
294                                     .getService(Components.interfaces.nsIPrefBranch);
295               var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
296                                         .getService(Components.interfaces.nsIURLFormatter);
297               var url = formatter.formatURLPref("extensions.blocklist.detailsURL");
298               blocklistMoreInfo.setAttribute("moreInfoURL", url);
299             } catch(e) {
300               blocklistMoreInfo.hidden = true;
301             }
302           }
304           if (!this.isCompatible) {
305             var label = document.getAnonymousElementByAttribute(this, "anonid", "incompatibleLabel");
306             label.setAttribute("value", this.parentNode._addonStrings.getFormattedString("incompatibleAddonMsg",
307                                         [this.parentNode.getBrandShortName(), this.parentNode.getAppVersion()]));
308           }
310           var updatedVersion = this.getAttribute('availableUpdateVersion');
311           if (updatedVersion) {
312             var msg = this.parentNode._addonStrings.getFormattedString("updateAvailableMsg", [updatedVersion]);
313             this.setAttribute("updateAvailableMsg", msg);
314           }
315         ]]>
316       </constructor>
318       <field name="_nameVersion">
319         document.getAnonymousElementByAttribute(this, "anonid", "addonNameVersion");
320       </field>
322       <field name="_descriptionWrap">
323         document.getAnonymousElementByAttribute(this, "anonid", "addonDescriptionWrap");
324       </field>
326       <field name="_selectedStatusMsgs">
327         document.getAnonymousElementByAttribute(this, "anonid", "addonSelectedStatusMsgs");
328       </field>
330       <field name="_opType">
331         document.getAnonymousElementByAttribute(this, "anonid", "addonOpType");
332       </field>
334       <property name="label" readonly="true">
335         <getter>
336           <![CDATA[
337             var labelPieces = [];
339             // Add name and version
340             labelPieces.push(this._nameVersion.getAttribute("name"));
341             labelPieces.push(this._nameVersion.getAttribute("version"));
343             // Add description
344             labelPieces.push(this._descriptionWrap.textContent);
346             // Add operation message (if any)
347             // Note 1: must handle this separately from other the labels
348             // because this message is in an anonymous content node
349             // within an hbox which is dynamically bound to a different
350             // "addon-needs-*" binding based on the operation type.
351             // Note 2: must check hbox's CSS "display" property with
352             // getComputedStyle, because the XUL "hidden" attribute
353             // never changes.
354             // Note 3: can't just check whether the hbox has anonymous
355             // child nodes.  If (for example) you disable an extension,
356             // the hbox gets bound to "addon-needs-disable".  But if
357             // you then immediately re-enable the same extension without
358             // closing the Add-ons window, the hbox is still bound to
359             // "addon-needs-disable" (and thus still has the anonymous
360             // content child nodes with the label containing the now-unused
361             // &toBeDisabled.label text), but the hbox is no longer visible.
362             if (document.defaultView.getComputedStyle(this._opType, '').display != 'none')
363               labelPieces.push(document.getAnonymousNodes(this._opType)[0].value);
365             // Add selected status messages, if any are visible.
366             // Note 1: visibility of status messages is set by CSS rule,
367             // not XUL attributes, so we need to use getComputedStyle.
368             // Note 2: relevant CSS rule is set on the label's parent node;
369             // the label node itself always has "display:-moz-box" which is
370             // not useful.
371             var labels = this._selectedStatusMsgs.getElementsByTagNameNS(
372               "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
373               "label");
374             var numLabels = labels.length;
375             for (var i = 0; i < numLabels; i++) {
376               var label = labels[i];
377               var parentStyle = document.defaultView.getComputedStyle(label.parentNode, "");
379               // Optimization: we only check a few cases here that we know
380               // are used by the Add-ons window.  For example, the generic
381               // richlistbox.xml label getter checks label.collapsed, but
382               // we don't check that here because we know that the Add-ons
383               // window doesn't use it.
384               if (!label.hidden &&
385                   label.className != "text-link" &&
386                   parentStyle.display != "none") {
387                 labelPieces.push(label.value);
388               }
389             }
391             return labelPieces.join(" ");
392           ]]>
393         </getter>
394       </property>
395     </implementation>
397     <handlers>
398 <!-- When an add-on displays a status messages the element may extend below the
399      bottom of the list This will ensure that the element is visible for the
400      most common cases. -->
401       <handler event="DOMAttrModified">
402         <![CDATA[
403           if (event.attrName != "disabled" ||
404               !this.parentNode.selectedItem ||
405               !event.originalTarget.hasAttribute("command"))
406             return;
408           var cmd = event.originalTarget.getAttribute("command");
409           var opType = this.getAttribute("opType");
410           if (opType == "needs-uninstall" && cmd == "cmd_uninstall" ||
411               opType == "needs-disable" && cmd == "cmd_disable" && !this.isDisabled ||
412               opType == "needs-enable" && cmd == "cmd_disable" && this.isDisabled)
413             this.parentNode.ensureElementIsVisible(this);
414         ]]>
415       </handler>
416     </handlers>
417   </binding>
418   
419   <binding id="searchresult" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
420     <resources>
421       <stylesheet src="chrome://mozapps/skin/extensions/extensions.css"/>
422     </resources>
424     <content>
425       <xul:hbox flex="1">
426         <xul:vbox class="addon-icon" xbl:inherits="iconURL"/>
427         <xul:vbox flex="1" class="addonTextBox">
428           <xul:hbox align="center">
429             <xul:hbox anonid="addonNameVersion" class="addon-name-version" xbl:inherits="name, version"/>
430             <xul:spacer flex="1"/>
431             <xul:image class="addonRating" xbl:inherits="rating"/>
432           </xul:hbox>
433           <xul:hbox anonid="addonDescription" class="addon-description" xbl:inherits="description, opType"/>
434         </xul:vbox>
435       </xul:hbox>
436     </content>
438     <implementation extends="nsIAccessibleProvider">
439       <property name="label" readonly="true">
440         <getter>
441           return this.getAttribute("name") + " " +
442             this.getAttribute("version") + " " +
443             this.getAttribute("description");
444         </getter>
445       </property>
447       <constructor>
448         if (!this.hasAttribute("thumbnailURL") || this._imageBlocked(this)) {
449           this._hideImage();
450           return;
451         }
453         if (this.hasAttribute("thumbwidth")) {
454           this._displayImage();
455           return;
456         }
458         var image = new Image();
459         var id = this.id;
460         image.onload = function() {
461           document.getElementById(id)._imageLoaded(image);
462         };
463         image.onerror = function() {
464           document.getElementById(id)._hideImage();
465         };
466         image.src = this.getAttribute("thumbnailURL");
467       </constructor>
469       <field name="_maxSize">125</field>
471       <method name="_imageBlocked">
472         <parameter name="container"/>
473         <body>
474           var uri = Components.classes["@mozilla.org/network/io-service;1"]
475                               .getService(Components.interfaces.nsIIOService)
476                               .newURI(container.getAttribute("thumbnailURL"),
477                                       container.ownerDocument.characterSet, null);
478           var contentPolicy = Components.classes["@mozilla.org/layout/content-policy;1"]
479                                         .getService(Components.interfaces.nsIContentPolicy);
480           return contentPolicy.shouldLoad(contentPolicy.TYPE_IMAGE,
481                                           uri, container.ownerDocument.documentURIObject,
482                                           container, null, null) != contentPolicy.ACCEPT;
483         </body>
484       </method>
486       <method name="_displayImage">
487         <body>
488         </body>
489       </method>
491       <method name="_hideImage">
492         <body>
493         </body>
494       </method>
496       <method name="_imageLoaded">
497         <parameter name="image"/>
498         <body>
499         <![CDATA[
500           if ((this._maxSize >= image.width) &&
501               (this._maxSize >= image.height)) {
502             var width = image.width;
503             var height = image.height;
504           }
505           else if (image.width > image.height) {
506             width = this._maxSize;
507             height = (this._maxSize / image.width) * image.height;
508           }
509           else {
510             height = this._maxSize;
511             width = (this._maxSize / image.height) * image.width;
512           }
514           this.setAttribute("thumbwidth", width);
515           this.setAttribute("thumbheight", height);
516           this._displayImage();
517         ]]>
518         </body>
519       </method>
520     </implementation>
521   </binding>
522   
523   <binding id="searchresult-selected" extends="chrome://mozapps/content/extensions/extensions.xml#searchresult">
524     <content>
525       <xul:hbox flex="1">
526         <xul:vbox class="addon-icon" xbl:inherits="iconURL"/>
527         <xul:vbox flex="1" class="addonTextBox">
528           <xul:hbox align="center">
529             <xul:hbox anonid="addonNameVersion" class="addon-name-version" xbl:inherits="name, version"/>
530             <xul:spacer flex="1"/>
531             <xul:image class="addonRating" xbl:inherits="rating"/>
532           </xul:hbox>
533           <xul:hbox flex="1" align="stretch" class="addon-search-details">
534             <xul:vbox pack="start">
535               <xul:deck class="addonThumbnailContainer" selectedIndex="0">
536                 <xul:vbox flex="1" align="center" pack="center">
537                   <xul:image class="addonThrobber"/>
538                 </xul:vbox>
539                 <xul:vbox flex="1" align="center" pack="center">
540                   <xul:image class="addonThumbnail"/>
541                 </xul:vbox>
542                 <xul:vbox flex="1" align="center" pack="center">
543                   <xul:label class="addonMissingThumbnail" value="&missingThumbnail.label;"/>
544                 </xul:vbox>
545               </xul:deck>
546             </xul:vbox>
547             <xul:vbox flex="1">
548               <xul:label anonid="addonDescriptionWrap" class="descriptionWrap"
549                          xbl:inherits="xbl:text=description"/>
550               <xul:hbox pack="start">
551                 <xul:label class="addonLearnMore text-link" xbl:inherits="homepageURL"
552                            value="&searchResultHomepage.value;"
553                            onclick="if (event.button == 0) { openURL(this.getAttribute('homepageURL')); }"/>
554               </xul:hbox>
555               <xul:spacer flex="1"/>
556               <xul:hbox anonid="selectedButtons" class="selectedButtons">
557                 <xul:hbox align="center" class="addonType addonTypeExtension">
558                   <xul:image/>
559                   <xul:label value="&addonTypeExtension.label;"/>
560                 </xul:hbox>
561                 <xul:hbox align="center" class="addonType addonTypeTheme">
562                   <xul:image/>
563                   <xul:label value="&addonTypeTheme.label;"/>
564                 </xul:hbox>
565                 <xul:spacer flex="1"/>
566                 <xul:hbox align="center" class="searchResultConnecting">
567                   <xul:image class="addonThrobber"/>
568                   <xul:label value="&searchResultConnecting.label;"/>
569                 </xul:hbox>
570                 <xul:hbox align="center" class="searchResultInstalling">
571                   <xul:image class="addonThrobber"/>
572                   <xul:label value="&searchResultInstalling.label;"/>
573                 </xul:hbox>
574                 <xul:hbox align="center" class="searchResultFailed">
575                   <xul:label value="&searchResultFailed.label;"/>
576                 </xul:hbox>
577                 <xul:hbox align="center" class="searchResultInstalled">
578                   <xul:label value="&searchResultInstalled.label;"/>
579                 </xul:hbox>
580                 <xul:button class="addonInstallButton"
581                             label="&cmd.installSearchResult.label;"
582                             accesskey="&cmd.installSearchResult.accesskey;"
583                             tooltiptext="&cmd.installSearchResult.tooltip;"
584                             command="cmd_installSearchResult"/>
585               </xul:hbox>
586             </xul:vbox>
587           </xul:hbox>
588         </xul:vbox>
589       </xul:hbox>
590     </content>
592     <implementation implements="nsIAccessibleProvider">
593       <field name="_thumbnailContainer">
594         document.getAnonymousElementByAttribute(this, "class", "addonThumbnailContainer");
595       </field>
596       <field name="_thumbnail">
597         document.getAnonymousElementByAttribute(this, "class", "addonThumbnail");
598       </field>
599       
600       <method name="_displayImage">
601         <body>
602           this._thumbnail.style.width = this.getAttribute("thumbwidth") + "px";
603           this._thumbnail.style.height = this.getAttribute("thumbheight") + "px";
604           this._thumbnail.src = this.getAttribute("thumbnailURL");
605           this._thumbnailContainer.selectedIndex = 1;
606         </body>
607       </method>
609       <method name="_hideImage">
610         <body>
611           this._thumbnailContainer.selectedIndex = 2;
612         </body>
613       </method>
614     </implementation>
615   </binding>
617   <binding id="status-search-failure">
618     <content align="center">
619       <xul:hbox align="center" pack="center">
620         <xul:image class="addonFailure"/>
621         <xul:label value="&searchFailed.label;"/>
622       </xul:hbox>
623       <xul:button command="cmd_resetSearch" label="&searchFailed.button;"/>
624     </content>
625   </binding>
627   <binding id="status-recommended-failure">
628     <content>
629       <xul:hbox align="center" pack="center">
630         <xul:image class="addonFailure"/>
631         <xul:label value="&searchFailed.label;"/>
632       </xul:hbox>
633     </content>
634   </binding>
636   <binding id="status-header-recommended">
637     <content>
638       <xul:label value="&recommendedHeader.label;"/>
639     </content>
640   </binding>
642   <binding id="status-message-nosearchresults">
643     <content>
644       <xul:hbox align="center" pack="center">
645         <xul:label value="&noSearchResults.label;"/>
646       </xul:hbox>
647     </content>
648   </binding>
650   <binding id="status-message-norecommended">
651     <content>
652       <xul:hbox align="center" pack="center">
653         <xul:label value="&noRecommendedResults.label;"/>
654       </xul:hbox>
655     </content>
656   </binding>
658   <binding id="status-footer-recommended">
659     <content align="end">
660       <xul:label class="text-link" xbl:inherits="recommendedURL=link" value="&recommendedResults.label;"
661                  onclick="if (event.button == 0) { openURL(this.getAttribute('recommendedURL')); }" />
662     </content>
663   </binding>
665   <binding id="status-footer-search">
666     <content align="stretch">
667       <xul:hbox align="center">
668         <xul:label class="text-link" xbl:inherits="searchURL=link" anonid="searchLink"
669                    onclick="if (event.button == 0) { openURL(this.getAttribute('searchURL')); }"/>
670         <xul:spacer flex="1"/>
671         <xul:button command="cmd_resetSearch" label="&resetSearch.label;"/>
672       </xul:hbox>
673     </content>
675     <implementation>
676       <constructor>
677         var strings = [this.getAttribute("count")];
678         var text = document.getElementById("extensionsStrings")
679                            .getFormattedString("searchResults", strings);
680         var label = document.getAnonymousElementByAttribute(this, "anonid", "searchLink");
681         label.value = text;
682       </constructor>
683     </implementation>
684   </binding>
686   <binding id="status-footer-search-empty">
687     <content align="center">
688       <xul:label value="&emptySearch.label;"/>
689       <xul:button command="cmd_resetSearch" label="&emptySearch.button;"/>
690     </content>
691   </binding>
693   <binding id="status-retrieve-search">
694     <content align="center">
695       <xul:hbox align="center" pack="center">
696         <xul:image class="addonThrobber"/>
697         <xul:label value="&searchThrobber.label;"/>
698       </xul:hbox>
699       <xul:button command="cmd_resetSearch" label="&cancelSearch.button;"/>
700     </content>
701   </binding>
703   <binding id="status-retrieve-recommended">
704     <content>
705       <xul:hbox align="center" pack="center">
706         <xul:image class="addonThrobber"/>
707         <xul:label value="&recommendedThrobber.label;"/>
708       </xul:hbox>
709     </content>
710   </binding>
712   <binding id="addon-icon">
713     <content>
714       <xul:stack class="addonIconStack">
715         <xul:vbox pack="center" align="center" class="addonIcon">
716           <xul:image xbl:inherits="src=iconURL"/>
717         </xul:vbox>
718         <xul:vbox pack="start" align="start" class="addonIcon pluginIcon">
719           <xul:image src="chrome://mozapps/skin/plugins/pluginGeneric.png"/>
720         </xul:vbox>
721         <xul:vbox pack="end" align="start">
722           <xul:image class="notifyBadge"/>
723         </xul:vbox>
724         <xul:vbox pack="end" align="end">
725           <xul:image class="updateBadge"/>
726         </xul:vbox>
727       </xul:stack>
728       <xul:spacer flex="1"/>
729     </content>
730   </binding>
732   <binding id="addon-name-version">
733     <content>
734       <xul:label class="addonName" crop="end" xbl:inherits="value=name"/>
735       <xul:label class="addonVersion" xbl:inherits="value=version"/>
736     </content>
737   </binding>
739   <binding id="addon-description-crop">
740     <content>
741       <xul:label class="descriptionCrop" xbl:inherits="value=description" flex="1" crop="end"/>
742     </content>
743   </binding>
745   <binding id="addon-needs-install">
746     <content>
747       <xul:label value="&toBeInstalled.label;" crop="end"/>
748     </content>
749   </binding>
751   <binding id="addon-needs-upgrade">
752     <content>
753       <xul:label value="&toBeUpdated.label;" crop="end"/>
754     </content>
755   </binding>
757   <binding id="addon-needs-uninstall">
758     <content>
759       <xul:label value="&toBeUninstalled.label;" crop="end"/>
760     </content>
761   </binding>
763   <binding id="addon-needs-enable">
764     <content>
765       <xul:label value="&toBeEnabled.label;" crop="end"/>
766     </content>
767   </binding>
769   <binding id="addon-needs-disable">
770     <content>
771       <xul:label value="&toBeDisabled.label;" crop="end"/>
772     </content>
773   </binding>
775   <binding id="update-checking" extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
776     <content>
777       <xul:hbox flex="1">
778         <xul:stack class="addonIconStack">
779           <xul:vbox pack="start" align="start">
780             <xul:image class="addonIcon" xbl:inherits="src=iconURL"/>
781           </xul:vbox>
782           <xul:vbox pack="end" align="end">
783             <xul:image class="updateBadge"/>
784           </xul:vbox>
785           <xul:vbox pack="end" align="start">
786             <xul:image class="notifyBadge"/>
787           </xul:vbox>
788         </xul:stack>
789         <xul:vbox flex="1">
790           <xul:hbox class="addon-name-version" xbl:inherits="name, version"/>
791           <xul:hbox>
792             <xul:label xbl:inherits="value=updateStatus" flex="1" crop="end"/>
793           </xul:hbox>
794         </xul:vbox>
795       </xul:hbox>
796     </content>
797   </binding>
799   <binding id="update-found" extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
800     <content>
801       <xul:hbox flex="1">
802         <xul:vbox pack="start" align="start">
803           <xul:image class="addonIcon" xbl:inherits="src=iconURL"/>
804         </xul:vbox>
805         <xul:vbox flex="1">
806           <xul:hbox class="addon-name-version" xbl:inherits="name, version"/>
807           <xul:hbox>
808             <xul:label xbl:inherits="value=updateAvailableMsg" flex="1" crop="end"/>
809           </xul:hbox>
810           <xul:hbox pack="end" align="end">
811             <xul:checkbox anonid="includeUpdate" class="includeUpdate" checked="true"
812             label="&includeUpdate.label;" tooltiptext="&includeUpdate.tooltip;"
813             includeUpdateAccesskey="&includeUpdate.accesskey;" accesskey="&includeUpdate.accesskey;"/>
814           </xul:hbox>
815         </xul:vbox>
816       </xul:hbox>
817     </content>
819     <implementation>
820       <constructor>
821         var updatedVersion = this.getAttribute('availableUpdateVersion');
822         var msg = this.parentNode._addonStrings.getFormattedString("updateAvailableMsg", [updatedVersion]);
823         this.setAttribute("updateAvailableMsg", msg);
824       </constructor>
825     </implementation>
827     <handlers>
828       <handler event="DOMMenuItemActive">
829         <![CDATA[
830           // 
831           var children = this.parentNode.children;
832           for (var i = 0; i < children.length; ++i) {
833             var checkbox = document.getAnonymousElementByAttribute(children[i], "anonid", "includeUpdate");
834             if (checkbox.hasAttribute("accesskey"))
835               checkbox.removeAttribute("accesskey");
836           }
837           checkbox = document.getAnonymousElementByAttribute(this, "anonid", "includeUpdate");
838           checkbox.setAttribute("accesskey", checkbox.getAttribute("includeUpdateAccesskey"));
839         ]]>
840       </handler>
841     </handlers>
842   </binding>
844   <binding id="install" extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
845     <content>
846       <xul:vbox flex="1">
847         <xul:hbox flex="1">
848           <xul:vbox>
849             <xul:stack class="addonIcon-stack">
850               <xul:vbox pack="start" align="start">
851                 <xul:image class="addonIcon" xbl:inherits="src=iconURL"/>
852               </xul:vbox>
853             </xul:stack>
854           </xul:vbox>
855           <xul:vbox flex="1">
856             <xul:hbox class="addon-name-version" xbl:inherits="name, version=newVersion"/>
857             <xul:hbox class="addon-install-status" xbl:inherits="state"/>
858           </xul:vbox>
859         </xul:hbox>
860         <xul:hbox flex="1" pack="end">
861           <xul:button class="upgradeShow cancelUpgradeButton" label="&cancelUpgrade.label;"
862                   accesskey="&cancelUpgrade.accesskey;" tooltiptext="&cmd.cancelUpgrade.tooltip;"
863                   command="cmd_cancelUpgrade"/>
864           <xul:button class="installShow cancelInstallButton" label="&cancelInstall.label;"
865                   accesskey="&cancelInstall.accesskey;" tooltiptext="&cmd.cancelInstall.tooltip;"
866                   command="cmd_cancelInstall"/>
867         </xul:hbox>
868       </xul:vbox>
869     </content>
870   </binding>
872   <binding id="addon-install-waiting">
873     <content>
874       <xul:label value="&installWaiting.label;" flex="1" crop="end"/>
875     </content>
876   </binding>
878   <binding id="addon-install-incompatibleUpdate">
879     <content>
880       <xul:label value="&installIncompatibleUpdate.label;" flex="1" crop="end"/>
881     </content>
882   </binding>
884   <binding id="addon-install-finishing">
885     <content>
886       <xul:label value="&installFinishing.label;" flex="1" crop="end"/>
887     </content>
888   </binding>
890   <binding id="addon-install-success">
891     <content>
892       <xul:label value="&installSuccess.label;" flex="1" crop="end"/>
893     </content>
894   </binding>
896   <binding id="addon-install-fail">
897     <content>
898       <xul:label value="&installFailure.label;" flex="1" crop="end"/>
899     </content>
900   </binding>
902   <binding id="addon-install-restart">
903     <content>
904       <xul:label value="&installSuccessRestart.label;" flex="1" crop="end"/>
905     </content>
906   </binding>
908   <binding id="addon-upgrade-restart">
909     <content>
910       <xul:label value="&updateSuccessRestart.label;" flex="1" crop="end"/>
911     </content>
912   </binding>
914   <binding id="addon-install-updated">
915     <content>
916       <xul:label value="&updateSuccess.label;" flex="1" crop="end"/>
917     </content>
918   </binding>
920   <binding id="install-downloading" extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
921     <content>
922       <xul:hbox flex="1">
923         <xul:vbox pack="start">
924           <xul:image class="addonIcon" xbl:inherits="src=iconURL"/>
925         </xul:vbox>
926         <xul:vbox flex="1" class="addonTextBox">
927           <xul:hbox class="addon-name-version" xbl:inherits="name, version=newVersion"/>
928           <xul:progressmeter class="extension-item-progress" xbl:inherits="value=progress"/>
929           <xul:label class="extension-item-status" xbl:inherits="value=status" value="&installWaiting.label;"/>
930         </xul:vbox>
931       </xul:hbox>
932     </content>  
933   </binding>
935 <!-- based on preferences.xml paneButton -->
936   <binding id="viewbutton" extends="chrome://global/content/bindings/radio.xml#radio">
937     <resources>
938       <stylesheet src="chrome://mozapps/skin/extensions/extensions.css"/>
939     </resources>
940     <content>
941       <xul:image class="viewButtonIcon" xbl:inherits="src"/>
942       <xul:label class="viewButtonLabel" xbl:inherits="value=label"/>
943     </content>
944     <implementation implements="nsIAccessibleProvider">
945       <property name="accessibleType" readonly="true">
946         <getter>
947           <![CDATA[
948             return Components.interfaces.nsIAccessibleProvider.XULListitem;
949           ]]>
950         </getter>
951       </property>
952     </implementation>
953   </binding>
955   <binding id="hardblockedaddon">
956     <content align="start">
957       <xul:image xbl:inherits="src=icon"/>
958       <xul:vbox flex="1">
959         <xul:hbox class="addon-name-version" xbl:inherits="name, version"/>
960         <xul:hbox>
961           <xul:spacer flex="1"/>
962           <xul:label class="blockedLabel" value="&blocklist.blocked.label;"/>
963         </xul:hbox>
964       </xul:vbox>
965     </content>
966   </binding>
968   <binding id="softblockedaddon">
969     <content align="start">
970       <xul:image xbl:inherits="src=icon"/>
971       <xul:vbox flex="1">
972         <xul:hbox class="addon-name-version" xbl:inherits="name, version"/>
973         <xul:hbox>
974           <xul:spacer flex="1"/>
975           <xul:checkbox class="disableCheckbox" checked="true" label="&blocklist.checkbox.label;"/>
976         </xul:hbox>
977       </xul:vbox>
978     </content>
979     <implementation>
980       <field name="_checkbox">
981         document.getAnonymousElementByAttribute(this, "class", "disableCheckbox")
982       </field>
983       <property name="checked" readonly="true">
984         <getter>
985           return this._checkbox.checked;
986         </getter>
987       </property>
988     </implementation>
989   </binding>
991 </bindings>