Bug 425116: Notification bars in addons manager use the wrong icon. p=dão, r=mossop, a=schrep
authordtownsend@oxymoronical.com
Fri, 09 May 2008 11:10:17 -0700
changeset 15088 7060bb03578de57cc88dd14de5cd7c406a8f508a
parent 15087 158fd09ebf69a16c6cd9e3e0cb6c925d11bd1a53
child 15089 0097310631c79054cf93e365e1b73082de485645
push idunknown
push userunknown
push dateunknown
reviewersmossop, schrep
bugs425116
milestone1.9pre
Bug 425116: Notification bars in addons manager use the wrong icon. p=dão, r=mossop, a=schrep
toolkit/mozapps/extensions/content/extensions.js
toolkit/themes/pinstripe/mozapps/jar.mn
toolkit/themes/winstripe/mozapps/jar.mn
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -89,16 +89,24 @@ const PREF_GENERAL_SKINS_SELECTEDSKIN   
 const PREF_UPDATE_NOTIFYUSER                = "extensions.update.notifyUser";
 const PREF_GETADDONS_SHOWPANE               = "extensions.getAddons.showPane";
 const PREF_GETADDONS_REPOSITORY             = "extensions.getAddons.repository";
 const PREF_GETADDONS_MAXRESULTS             = "extensions.getAddons.maxResults";
 
 const URI_GENERIC_ICON_XPINSTALL      = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png";
 const URI_GENERIC_ICON_THEME          = "chrome://mozapps/skin/extensions/themeGeneric.png";
 
+#ifdef MOZ_WIDGET_GTK2
+const URI_NOTIFICATION_ICON_INFO      = "moz-icon://stock/gtk-dialog-info?size=menu";
+const URI_NOTIFICATION_ICON_WARNING   = "moz-icon://stock/gtk-dialog-warning?size=menu";
+#else
+const URI_NOTIFICATION_ICON_INFO      = "chrome://global/skin/icons/information-16.png";
+const URI_NOTIFICATION_ICON_WARNING   = "chrome://global/skin/icons/warning-16.png";
+#endif
+
 const RDFURI_ITEM_ROOT    = "urn:mozilla:item:root";
 const PREFIX_ITEM_URI     = "urn:mozilla:item:";
 const PREFIX_NS_EM        = "http://www.mozilla.org/2004/em-rdf#";
 const kXULNSURI           = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 const XMLURI_PARSE_ERROR  = "http://www.mozilla.org/newlayout/xml/parsererror.xml"
 
 const OP_NONE                         = "";
 const OP_NEEDS_INSTALL                = "needs-install";
@@ -1062,51 +1070,39 @@ function Startup()
 
   gObserverIndex = gExtensionManager.addInstallListener(gDownloadManager);
 
   if (!gCheckCompat) {
     var msgText = getExtensionString("disabledCompatMsg");
     var buttonLabel = getExtensionString("enableButtonLabel");
     var buttonAccesskey = getExtensionString("enableButtonAccesskey");
     var notifyData = "addons-enable-compatibility";
-#ifdef MOZ_WIDGET_GTK2
-    showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-    showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+    showMessage(URI_NOTIFICATION_ICON_WARNING,
                 msgText, buttonLabel, buttonAccesskey,
                 true, notifyData);
   }
   if (!gCheckUpdateSecurity) {
     var defaultCheckSecurity = true;
     try {
       defaultCheckSecurity = defaultPref.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
     } catch (e) { }
 
     // App has update security checking enabled by default so show warning
     if (defaultCheckSecurity) {
       var msgText = getExtensionString("disabledUpdateSecurityMsg");
       var buttonLabel = getExtensionString("enableButtonLabel");
       var buttonAccesskey = getExtensionString("enableButtonAccesskey");
       var notifyData = "addons-enable-updatesecurity";
-#ifdef MOZ_WIDGET_GTK2
-      showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-      showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+      showMessage(URI_NOTIFICATION_ICON_WARNING,
                   msgText, buttonLabel, buttonAccesskey,
                   true, notifyData);
     }
   }
   if (gInSafeMode) {
-#ifdef MOZ_WIDGET_GTK2
-    showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-    showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+    showMessage(URI_NOTIFICATION_ICON_INFO,
                 getExtensionString("safeModeMsg"),
                 null, null, true, null);
   }
 
   gExtensionsView.builder.addListener(TemplateBuilderListener);
 
   if ("arguments" in window) {
     try {
@@ -1120,34 +1116,26 @@ function Startup()
 #ifdef MOZ_PHOENIX
         // If we are Firefox when updating on startup don't display context
         // menuitems that can open a browser window.
         gUpdateContextMenus = gUpdateContextMenusNoBrowser;
 #endif
         document.getElementById("viewGroup").hidden = true;
         document.getElementById("extensionsView").setAttribute("norestart", "");
         showView("updates");
-#ifdef MOZ_WIDGET_GTK2
-        showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-        showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+        showMessage(URI_NOTIFICATION_ICON_INFO,
                     getExtensionString("newUpdatesAvailableMsg"),
                     null, null, true, null);
         document.title = getExtensionString("newUpdateWindowTitle", [getBrandShortName()]);
       }
       else if (window.arguments.length == 2) {
         gNewAddons = window.arguments[1].split(",");
         var installMsg = PluralForm.get(gNewAddons.length, getExtensionString("newAddonsNotificationMsg2"));
         installMsg = installMsg.replace("%S", gNewAddons.length);
-#ifdef MOZ_WIDGET_GTK2
-        showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-        showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+        showMessage(URI_NOTIFICATION_ICON_INFO,
                     installMsg, null, null, true, null);
         var extensionCount = 0;
         var themeCount = 0;
         var localeCount = 0;
         for (var i = 0; i < gNewAddons.length; i++) {
           var item = gExtensionManager.getItemForID(gNewAddons[i]);
           switch (item.type) {
             case Components.interfaces.nsIUpdateItem.TYPE_EXTENSION:
@@ -1455,21 +1443,17 @@ UpdateCheckListener.prototype = {
     viewGroup.hidden = false;
     gExtensionsView.removeAttribute("update-operation");
     gExtensionsViewController.onCommandUpdate();
     updateOptionalViews();
     updateGlobalCommands();
     if (this._updateFound)
       showView("updates");
     else {
-#ifdef MOZ_WIDGET_GTK2
-      showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-      showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+      showMessage(URI_NOTIFICATION_ICON_INFO,
                   getExtensionString("noUpdatesMsg"),
                   null, null, true, "addons-no-updates");
       window.addEventListener("select", noUpdatesDismiss, true);
     }
   },
 
   /**
    * See nsIExtensionManager.idl
@@ -2032,35 +2016,27 @@ function isXPInstallEnabled() {
   }
   catch (e) { }
 
   var msgText = getExtensionString(locked ? "xpinstallDisabledMsgLocked" :
                                             "xpinstallDisabledMsg");
   var buttonLabel = locked ? null : getExtensionString("enableButtonLabel");
   var buttonAccesskey = locked ? null : getExtensionString("enableButtonAccesskey");
   var notifyData = locked ? null : "addons-enable-xpinstall";
-#ifdef MOZ_WIDGET_GTK2
-  showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-  showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+  showMessage(URI_NOTIFICATION_ICON_WARNING,
               msgText, buttonLabel, buttonAccesskey,
               !locked, notifyData);
   return false;
 }
 
 function isOffline(messageKey) {
   var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                             .getService(nsIIOService);
   if (ioService.offline) {
-#ifdef MOZ_WIDGET_GTK2
-    showMessage("moz-icon://stock/gtk-dialog-info?size=menu",
-#else
-    showMessage("chrome://mozapps/skin/extensions/question.png",
-#endif
+    showMessage(URI_NOTIFICATION_ICON_WARNING,
                 getExtensionString(messageKey, [getBrandShortName()]),
                 getExtensionString("goOnlineButtonLabel"),
                 getExtensionString("goOnlineButtonAccesskey"),
                 true, "addons-go-online");
   }
   return ioService.offline;
 }
 
@@ -2082,17 +2058,17 @@ function enableRestartButton() {
   var notification = addonsMsg.getNotificationWithValue("restart-app");
   if (!notification) {
     var appname = getBrandShortName();
     var message = getExtensionString("restartMessage", [appname]);
     var buttons = [ new MessageButton(getExtensionString("restartButton", [appname]),
                                       getExtensionString("restartAccessKey"),
                                       "addons-restart-app") ];
     addonsMsg.appendNotification(message, "restart-app",
-                                 "chrome://mozapps/skin/extensions/question.png",
+                                 URI_NOTIFICATION_ICON_INFO,
                                  addonsMsg.PRIORITY_WARNING_HIGH, buttons);
   }
 }
 
 function disableRestartButton() {
   var addonsMsg = document.getElementById("addonsMsg");
   var notification = addonsMsg.getNotificationWithValue("restart-app");
   if (notification)
--- a/toolkit/themes/pinstripe/mozapps/jar.mn
+++ b/toolkit/themes/pinstripe/mozapps/jar.mn
@@ -5,17 +5,16 @@ classic.jar:
   skin/classic/mozapps/downloads/downloadIcon.png                 (downloads/downloadIcon.png)
   skin/classic/mozapps/downloads/downloadStatusIcon.png           (downloads/downloadStatusIcon.png)
   skin/classic/mozapps/downloads/downloads.css                    (downloads/downloads.css)
   skin/classic/mozapps/downloads/unknownContentType.css           (downloads/unknownContentType.css)
   skin/classic/mozapps/extensions/extensionItem.png               (extensions/extensionItem.png)
   skin/classic/mozapps/extensions/itemDisabledFader.png           (extensions/itemDisabledFader.png)
   skin/classic/mozapps/extensions/itemEnabledFader.png            (extensions/itemEnabledFader.png)
   skin/classic/mozapps/extensions/notifyBadges.png                (extensions/notifyBadges.png)
-  skin/classic/mozapps/extensions/question.png                    (extensions/question.png)
   skin/classic/mozapps/extensions/themeGeneric.png                (extensions/themeGeneric.png)
   skin/classic/mozapps/extensions/viewButtons.png                 (extensions/viewButtons.png)
   skin/classic/mozapps/extensions/ratings.png                     (extensions/ratings.png)
   skin/classic/mozapps/extensions/extensionIcons.png              (extensions/extensionIcons.png)
   skin/classic/mozapps/extensions/searchIcons.png                 (extensions/searchIcons.png)
   skin/classic/mozapps/extensions/about.css                       (extensions/about.css)
   skin/classic/mozapps/extensions/extensions.css                  (extensions/extensions.css)
   skin/classic/mozapps/extensions/extensions.xml                  (extensions/extensions.xml)
--- a/toolkit/themes/winstripe/mozapps/jar.mn
+++ b/toolkit/themes/winstripe/mozapps/jar.mn
@@ -7,17 +7,16 @@ classic.jar:
         skin/classic/mozapps/downloads/downloadIcon.png            (downloads/downloadIcon.png)
         skin/classic/mozapps/downloads/downloads.css               (downloads/downloads.css)
         skin/classic/mozapps/downloads/unknownContentType.css      (downloads/unknownContentType.css)
         skin/classic/mozapps/extensions/about.css                  (extensions/about.css)
         skin/classic/mozapps/extensions/extensions.css             (extensions/extensions.css)
         skin/classic/mozapps/extensions/itemDisabledFader.png      (extensions/itemDisabledFader.png)
         skin/classic/mozapps/extensions/itemEnabledFader.png       (extensions/itemEnabledFader.png)
         skin/classic/mozapps/extensions/notifyBadges.png           (extensions/notifyBadges.png)
-        skin/classic/mozapps/extensions/question.png               (extensions/question.png)
         skin/classic/mozapps/extensions/update.css                 (extensions/update.css)
         skin/classic/mozapps/extensions/themeGeneric.png           (extensions/themeGeneric.png)
         skin/classic/mozapps/extensions/viewButtons.png            (extensions/viewButtons.png)
         skin/classic/mozapps/extensions/ratings.png                (extensions/ratings.png)
         skin/classic/mozapps/extensions/extensionIcons.png         (extensions/extensionIcons.png)
         skin/classic/mozapps/extensions/searchIcons.png            (extensions/searchIcons.png)
         skin/classic/mozapps/extensions/eula.css                   (extensions/eula.css)
         skin/classic/mozapps/handling/handling.css                 (handling/handling.css)
@@ -52,17 +51,16 @@ classic.jar:
         skin/classic/aero/mozapps/downloads/downloadIcon.png               (downloads/downloadIcon-aero.png)
         skin/classic/aero/mozapps/downloads/downloads.css                  (downloads/downloads.css)
         skin/classic/aero/mozapps/downloads/unknownContentType.css         (downloads/unknownContentType.css)
         skin/classic/aero/mozapps/extensions/about.css                     (extensions/about.css)
         skin/classic/aero/mozapps/extensions/extensions.css                (extensions/extensions.css)
         skin/classic/aero/mozapps/extensions/itemDisabledFader.png         (extensions/itemDisabledFader.png)
         skin/classic/aero/mozapps/extensions/itemEnabledFader.png          (extensions/itemEnabledFader.png)
         skin/classic/aero/mozapps/extensions/notifyBadges.png              (extensions/notifyBadges-aero.png)
-        skin/classic/aero/mozapps/extensions/question.png                  (extensions/question-aero.png)
         skin/classic/aero/mozapps/extensions/update.css                    (extensions/update.css)
         skin/classic/aero/mozapps/extensions/themeGeneric.png              (extensions/themeGeneric-aero.png)
         skin/classic/aero/mozapps/extensions/viewButtons.png               (extensions/viewButtons-aero.png)
         skin/classic/aero/mozapps/extensions/ratings.png                   (extensions/ratings-aero.png)
         skin/classic/aero/mozapps/extensions/extensionIcons.png            (extensions/extensionIcons-aero.png)
         skin/classic/aero/mozapps/extensions/searchIcons.png               (extensions/searchIcons-aero.png)
         skin/classic/aero/mozapps/extensions/eula.css                      (extensions/eula.css)
         skin/classic/aero/mozapps/handling/handling.css                    (handling/handling.css)