Index: browser/components/preferences/handlers.xml
===================================================================
RCS file: /cvsroot/mozilla/browser/components/preferences/handlers.xml,v
retrieving revision 1.1
diff -p -u -8 -r1.1 handlers.xml
--- browser/components/preferences/handlers.xml 6 Sep 2007 04:55:45 -0000 1.1
+++ browser/components/preferences/handlers.xml 29 Sep 2007 07:17:45 -0000
@@ -57,32 +57,34 @@
-
+
-
+
Index: browser/components/preferences/applications.js
===================================================================
RCS file: /cvsroot/mozilla/browser/components/preferences/applications.js,v
retrieving revision 1.14
diff -p -u -8 -r1.14 applications.js
--- browser/components/preferences/applications.js 28 Sep 2007 22:50:24 -0000 1.14
+++ browser/components/preferences/applications.js 29 Sep 2007 07:17:45 -0000
@@ -92,16 +92,19 @@ const PREF_FEED_SELECTED_ACTION = "brows
const PREF_FEED_SELECTED_READER = "browser.feeds.handler.default";
// The nsHandlerInfoAction enumeration values in nsIHandlerInfo identify
// the actions the application can take with content of various types.
// But since nsIHandlerInfo doesn't support plugins, there's no value
// identifying the "use plugin" action, so we use this constant instead.
const kActionUsePlugin = 5;
+const ICON_URL_PLUGIN = "chrome://browser/skin/preferences/plugin.png";
+const ICON_URL_LIVEMARK = "chrome://browser/skin/page-livemarks.png";
+const ICON_URL_APP = "chrome://browser/skin/preferences/application.png";
//****************************************************************************//
// Utilities
function getDisplayNameForFile(aFile) {
/*
#ifdef XP_WIN
*/
@@ -908,17 +911,18 @@ var gApplicationsPane = {
if (this._sortColumn)
this._sortTypes(visibleTypes);
for each (let visibleType in visibleTypes) {
let item = document.createElement("richlistitem");
item.setAttribute("type", visibleType.type);
item.setAttribute("typeDescription", visibleType.description);
- item.setAttribute("typeIcon", visibleType.smallIcon);
+ if (visibleType.smallIcon)
+ item.setAttribute("typeIcon", visibleType.smallIcon);
item.setAttribute("actionDescription",
this._describePreferredAction(visibleType));
item.setAttribute("actionIcon",
this._getIconURLForPreferredAction(visibleType));
this._list.appendChild(item);
}
this._selectLastSelectedType();
@@ -1106,38 +1110,33 @@ var gApplicationsPane = {
if (handlerInfo.alwaysAskBeforeHandling)
menu.selectedItem = menuItem;
menuItem = document.createElementNS(kXULNS, "menuitem");
menuItem.setAttribute("action", Ci.nsIHandlerInfo.handleInternally);
label = this._prefsBundle.getFormattedString("liveBookmarksInApp",
[this._brandShortName]);
menuItem.setAttribute("label", label);
- menuItem.setAttribute("image", "chrome://browser/skin/page-livemarks.png");
+ menuItem.setAttribute("image", ICON_URL_LIVEMARK);
menuPopup.appendChild(menuItem);
if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.handleInternally)
menu.selectedItem = menuItem;
// Add a separator to distinguish these items from the helper app items
// that follow them.
menuItem = document.createElementNS(kXULNS, "menuseparator");
menuPopup.appendChild(menuItem);
}
// Create a menu item for the OS default application, if any.
if (handlerInfo.hasDefaultHandler) {
let menuItem = document.createElementNS(kXULNS, "menuitem");
menuItem.setAttribute("action", Ci.nsIHandlerInfo.useSystemDefault);
menuItem.setAttribute("label", handlerInfo.defaultDescription);
-
- if (handlerInfo.wrappedHandlerInfo) {
- let iconURL =
- this._getIconURLForSystemDefault(handlerInfo.wrappedHandlerInfo);
- menuItem.setAttribute("image", iconURL);
- }
+ menuItem.setAttribute("image", this._getIconURLForSystemDefault(handlerInfo));
menuPopup.appendChild(menuItem);
if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.useSystemDefault)
menu.selectedItem = menuItem;
}
// Create menu items for possible handlers.
let preferredApp = handlerInfo.preferredApplicationHandler;
@@ -1172,16 +1171,17 @@ var gApplicationsPane = {
// Create a menu item for the plugin.
if (handlerInfo.plugin) {
let menuItem = document.createElementNS(kXULNS, "menuitem");
menuItem.setAttribute("action", kActionUsePlugin);
let label = this._prefsBundle.getFormattedString("pluginName",
[handlerInfo.plugin.name,
this._brandShortName]);
menuItem.setAttribute("label", label);
+ menuItem.setAttribute("image", ICON_URL_PLUGIN);
menuPopup.appendChild(menuItem);
if (handlerInfo.preferredAction == kActionUsePlugin)
menu.selectedItem = menuItem;
}
// Create a menu item for selecting a local application.
{
let menuItem = document.createElementNS(kXULNS, "menuitem");
@@ -1345,20 +1345,21 @@ var gApplicationsPane = {
handlerInfo.alwaysAskBeforeHandling = false;
// Set the preferred action.
handlerInfo.preferredAction = action;
}
handlerInfo.store();
- // Update the action label so it says the right thing once this type item
- // is no longer selected.
+ // Update the action label and image to reflect the new preferred action.
typeItem.setAttribute("actionDescription",
this._describePreferredAction(handlerInfo));
+ typeItem.setAttribute("actionIcon",
+ this._getIconURLForPreferredAction(handlerInfo));
},
chooseApp: function(aEvent) {
// Don't let the normal "on select action" handler get this event,
// as we handle it specially ourselves.
aEvent.stopPropagation();
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
@@ -1405,25 +1406,34 @@ var gApplicationsPane = {
// when we rebuild the list or when the user returns to the prefpane.
onSelectionChanged: function() {
if (this._list.selectedItem)
this._list.setAttribute("lastSelectedType",
this._list.selectedItem.getAttribute("type"));
},
_getIconURLForPreferredAction: function(aHandlerInfo) {
- var preferredApp = aHandlerInfo.preferredApplicationHandler;
+ switch (aHandlerInfo.preferredAction) {
+ case Ci.nsIHandlerInfo.handleInternally:
+ if (aHandlerInfo.type == TYPE_MAYBE_FEED)
+ return ICON_URL_LIVEMARK;
+ break;
- if (aHandlerInfo.preferredAction == Ci.nsIHandlerInfo.useHelperApp &&
- this.isValidHandlerApp(preferredApp))
- return this._getIconURLForHandlerApp(preferredApp);
-
- if (aHandlerInfo.preferredAction == Ci.nsIHandlerInfo.useSystemDefault &&
- aHandlerInfo.wrappedHandlerInfo)
- return this._getIconURLForSystemDefault(aHandlerInfo.wrappedHandlerInfo);
+ case Ci.nsIHandlerInfo.useSystemDefault:
+ return this._getIconURLForSystemDefault(aHandlerInfo);
+
+ case Ci.nsIHandlerInfo.useHelperApp:
+ let preferredApp = aHandlerInfo.preferredApplicationHandler;
+ if (this.isValidHandlerApp(preferredApp))
+ return this._getIconURLForHandlerApp(preferredApp);
+ break;
+
+ case kActionUsePlugin:
+ return ICON_URL_PLUGIN;
+ }
// We don't know how to get an icon URL for any other actions.
return "";
},
_getIconURLForHandlerApp: function(aHandlerApp) {
if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
return this._getIconURLForFile(aHandlerApp.executable);
@@ -1458,27 +1468,32 @@ var gApplicationsPane = {
if (/^https?/.test(uri.scheme))
return uri.prePath + "/favicon.ico";
return "";
},
_getIconURLForSystemDefault: function(aHandlerInfo) {
- // Handler info objects for MIME types on Windows implement a property
- // bag interface from which we can get an icon for the default app, so if
- // we're dealing with a MIME type on Windows, then try to get the icon.
- if (aHandlerInfo instanceof Ci.nsIMIMEInfo &&
- aHandlerInfo instanceof Ci.nsIPropertyBag) {
- try {
- let url = aHandlerInfo.getProperty("defaultApplicationIconURL");
- if (url)
- return url + "?size=16";
+ // Handler info objects for MIME types on some OSes implement a property bag
+ // interface from which we can get an icon for the default app, so if we're
+ // dealing with a MIME type on one of those OSes, then try to get the icon.
+ if ("wrappedHandlerInfo" in aHandlerInfo) {
+ let wrappedHandlerInfo = aHandlerInfo.wrappedHandlerInfo;
+
+ if (wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
+ wrappedHandlerInfo instanceof Ci.nsIPropertyBag) {
+ try {
+ let url = wrappedHandlerInfo.getProperty("defaultApplicationIconURL");
+ if (url)
+ return url + "?size=16";
+ }
+ catch(ex) {}
}
- catch(ex) {}
}
- // We don't know how to get an icon URL on any other OSes or for any other
- // classes of content type.
- return "";
+ // If this isn't a MIME type object on an OS that supports retrieving
+ // the icon, or if we couldn't retrieve the icon for some other reason,
+ // then use a generic icon.
+ return ICON_URL_APP;
}
};
Index: browser/themes/pinstripe/browser/jar.mn
===================================================================
RCS file: /cvsroot/mozilla/browser/themes/pinstripe/browser/jar.mn,v
retrieving revision 1.59
diff -p -u -8 -r1.59 jar.mn
--- browser/themes/pinstripe/browser/jar.mn 25 Sep 2007 22:05:53 -0000 1.59
+++ browser/themes/pinstripe/browser/jar.mn 29 Sep 2007 07:17:45 -0000
@@ -60,17 +60,19 @@ classic.jar:
#ifdef MOZ_SAFE_BROWSING
skin/classic/browser/safebrowsing/browser-protection.css (safebrowsing/browser-protection.css)
skin/classic/browser/safebrowsing/close16x16.png (safebrowsing/close16x16.png)
skin/classic/browser/safebrowsing/dim.png (safebrowsing/dim.png)
skin/classic/browser/safebrowsing/tail.png (safebrowsing/tail.png)
skin/classic/browser/safebrowsing/warning16x16.png (safebrowsing/warning16x16.png)
skin/classic/browser/safebrowsing/warning24x24.png (safebrowsing/warning24x24.png)
#endif
+ skin/classic/browser/preferences/application.png (preferences/application.png)
skin/classic/browser/preferences/Options.png (preferences/Options.png)
+ skin/classic/browser/preferences/plugin.png (preferences/plugin.png)
skin/classic/browser/preferences/preferences.css (preferences/preferences.css)
skin/classic/browser/tabbrowser/alltabs-box-bkgnd.png (tabbrowser/alltabs-box-bkgnd.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-bkgnd.png (tabbrowser/alltabs-box-overflow-bkgnd.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-bkgnd-animate.png)
skin/classic/browser/tabbrowser/tab-arrow-start.png (tabbrowser/tab-arrow-start.png)
skin/classic/browser/tabbrowser/tab-arrow-start-bkgnd.png (tabbrowser/tab-arrow-start-bkgnd.png)
skin/classic/browser/tabbrowser/tab-arrow-start-bkgnd-animate.png (tabbrowser/tab-arrow-start-bkgnd-animate.png)
skin/classic/browser/tabbrowser/tab-arrow-end.png (tabbrowser/tab-arrow-end.png)
Index: browser/themes/winstripe/browser/jar.mn
===================================================================
RCS file: /cvsroot/mozilla/browser/themes/winstripe/browser/jar.mn,v
retrieving revision 1.55
diff -p -u -8 -r1.55 jar.mn
--- browser/themes/winstripe/browser/jar.mn 25 Sep 2007 22:05:54 -0000 1.55
+++ browser/themes/winstripe/browser/jar.mn 29 Sep 2007 07:17:45 -0000
@@ -51,17 +51,19 @@ classic.jar:
#ifdef MOZ_SAFE_BROWSING
skin/classic/browser/safebrowsing/browser-protection.css (safebrowsing/browser-protection.css)
skin/classic/browser/safebrowsing/close16x16.png (safebrowsing/close16x16.png)
skin/classic/browser/safebrowsing/dim.png (safebrowsing/dim.png)
skin/classic/browser/safebrowsing/tail.png (safebrowsing/tail.png)
skin/classic/browser/safebrowsing/warning16x16.png (safebrowsing/warning16x16.png)
skin/classic/browser/safebrowsing/warning24x24.png (safebrowsing/warning24x24.png)
#endif
+ skin/classic/browser/preferences/application.png (preferences/application.png)
skin/classic/browser/preferences/Options.png (preferences/Options.png)
+ skin/classic/browser/preferences/plugin.png (preferences/plugin.png)
skin/classic/browser/preferences/preferences.css (preferences/preferences.css)
skin/classic/browser/tabbrowser/alltabs-box-overflow-end-bkgnd.png (tabbrowser/alltabs-box-overflow-end-bkgnd.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-hover.png (tabbrowser/alltabs-box-overflow-end-bkgnd-hover.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-start-bkgnd.png (tabbrowser/alltabs-box-overflow-start-bkgnd.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-hover.png (tabbrowser/alltabs-box-overflow-start-bkgnd-hover.png)
skin/classic/browser/tabbrowser/close-bkgnd.png (tabbrowser/close-bkgnd.png)