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 28 Sep 2007 03:28:23 -0000
@@ -57,32 +57,34 @@
-
+
-
+
Index: browser/components/preferences/applications.js
===================================================================
RCS file: /cvsroot/mozilla/browser/components/preferences/applications.js,v
retrieving revision 1.11
diff -p -u -8 -r1.11 applications.js
--- browser/components/preferences/applications.js 24 Sep 2007 18:27:15 -0000 1.11
+++ browser/components/preferences/applications.js 28 Sep 2007 03:28:23 -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);
if (visibleType.type == this._list.getAttribute("lastSelectedType"))
this._list.selectedItem = item;
}
@@ -1087,38 +1091,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;
@@ -1150,16 +1149,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 saving to disk.
// Note: this option isn't available to protocol types, since we don't know
// what it means to save a URL having a certain scheme to disk, nor is it
@@ -1322,20 +1322,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);
@@ -1381,25 +1382,34 @@ var gApplicationsPane = {
// Mark which item in the list was last selected so we can reselect it
// when we rebuild the list or when the user returns to the prefpane.
onSelectionChanged: function() {
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);
@@ -1434,27 +1444,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 28 Sep 2007 03:28:23 -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 28 Sep 2007 03:28:23 -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)
Index: browser/themes/pinstripe/browser/preferences/application.png
===================================================================
RCS file: browser/themes/pinstripe/browser/preferences/application.png
diff -N browser/themes/pinstripe/browser/preferences/application.png
Binary files /dev/null and application.png differ
Index: browser/themes/pinstripe/browser/preferences/Options.png
===================================================================
RCS file: /cvsroot/mozilla/browser/themes/pinstripe/browser/preferences/Options.png,v
retrieving revision 1.6
diff -p -u -8 -r1.6 Options.png
Binary files /tmp/cvsAtjqpc and Options.png differ
Index: browser/themes/pinstripe/browser/preferences/plugin.png
===================================================================
RCS file: browser/themes/pinstripe/browser/preferences/plugin.png
diff -N browser/themes/pinstripe/browser/preferences/plugin.png
Binary files /dev/null and plugin.png differ
Index: browser/themes/winstripe/browser/preferences/application.png
===================================================================
RCS file: browser/themes/winstripe/browser/preferences/application.png
diff -N browser/themes/winstripe/browser/preferences/application.png
Binary files /dev/null and application.png differ
Index: browser/themes/winstripe/browser/preferences/Options.png
===================================================================
RCS file: /cvsroot/mozilla/browser/themes/winstripe/browser/preferences/Options.png,v
retrieving revision 1.5
diff -p -u -8 -r1.5 Options.png
Binary files /tmp/cvs0Oj70H and Options.png differ
Index: browser/themes/winstripe/browser/preferences/plugin.png
===================================================================
RCS file: browser/themes/winstripe/browser/preferences/plugin.png
diff -N browser/themes/winstripe/browser/preferences/plugin.png
Binary files /dev/null and plugin.png differ