Bug 711291 - Add support for icon URL option to PopupNotifications.show. r=gavin

This commit is contained in:
Dão Gottwald 2011-12-18 04:01:59 +01:00
Родитель 3f8dea5bfd
Коммит b16d287a97
3 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -944,7 +944,7 @@
<binding id="geolocation-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
<content align="start">
<xul:image class="popup-notification-icon"
xbl:inherits="popupid"/>
xbl:inherits="popupid,src=icon"/>
<xul:vbox flex="1">
<xul:description class="popup-notification-description"
xbl:inherits="xbl:text=label"/>
@ -988,7 +988,7 @@
<binding id="addon-progress-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
<content align="start">
<xul:image class="popup-notification-icon"
xbl:inherits="popupid"/>
xbl:inherits="popupid,src=icon"/>
<xul:vbox flex="1">
<xul:description class="popup-notification-description addon-progress-description"
xbl:inherits="xbl:text=label"/>

Просмотреть файл

@ -225,6 +225,10 @@ PopupNotifications.prototype = {
* removed when they would have otherwise been dismissed
* (i.e. any time the popup is closed due to user
* interaction).
* popupIconURL:
* A string. URL of the image to be displayed in the popup.
* Normally specified in CSS using list-style-image and the
* .popup-notification-icon[popupid=...] selector.
* @returns the Notification object corresponding to the added notification.
*/
show: function PopupNotifications_show(browser, id, message, anchorID,
@ -401,6 +405,8 @@ PopupNotifications.prototype = {
popupnotification.setAttribute("menucommand", "PopupNotifications._onMenuCommand(event);");
popupnotification.setAttribute("closeitemcommand", "PopupNotifications._dismiss();event.stopPropagation();");
}
if (n.options.popupIconURL)
popupnotification.setAttribute("icon", n.options.popupIconURL);
popupnotification.notification = n;
if (n.secondaryActions) {

Просмотреть файл

@ -435,7 +435,7 @@
<binding id="popup-notification">
<content align="start">
<xul:image class="popup-notification-icon"
xbl:inherits="popupid"/>
xbl:inherits="popupid,src=icon"/>
<xul:vbox flex="1">
<xul:description class="popup-notification-description"
xbl:inherits="xbl:text=label"/>