bug 377784: new Applications prefpane, which replaces the Download Actions dialog and the Feeds prefpane and provides a better UI for configuring handlers for MIME types and protocol schemes; r=gavin, ui-r=mconnor
authormyk@mozilla.org
Wed, 05 Sep 2007 21:55:45 -0700
changeset 5759 045452b30d72da2f45f0a89ce9247227b39dc38c
parent 5758 2ab2a9eae9716de607700dac13cd88ce609117dc
child 5760 e68b3c36615153b880be6952bd21dec96af1af54
push idunknown
push userunknown
push dateunknown
reviewersgavin, mconnor
bugs377784
milestone1.9a8pre
bug 377784: new Applications prefpane, which replaces the Download Actions dialog and the Feeds prefpane and provides a better UI for configuring handlers for MIME types and protocol schemes; r=gavin, ui-r=mconnor
browser/components/feeds/public/nsIWebContentConverterRegistrar.idl
browser/components/feeds/src/WebContentConverter.js
browser/components/preferences/applications.js
browser/components/preferences/applications.xul
browser/components/preferences/changeaction.js
browser/components/preferences/changeaction.xul
browser/components/preferences/content.js
browser/components/preferences/content.xul
browser/components/preferences/downloadactions.js
browser/components/preferences/downloadactions.xul
browser/components/preferences/feeds.js
browser/components/preferences/feeds.xul
browser/components/preferences/handlers.css
browser/components/preferences/handlers.xml
browser/components/preferences/jar.mn
browser/components/preferences/preferences.xul
browser/locales/en-US/chrome/browser/preferences/applications.dtd
browser/locales/en-US/chrome/browser/preferences/changeaction.dtd
browser/locales/en-US/chrome/browser/preferences/content.dtd
browser/locales/en-US/chrome/browser/preferences/downloadactions.dtd
browser/locales/en-US/chrome/browser/preferences/feeds.dtd
browser/locales/en-US/chrome/browser/preferences/feeds.properties
browser/locales/en-US/chrome/browser/preferences/preferences.dtd
browser/locales/en-US/chrome/browser/preferences/preferences.properties
browser/locales/jar.mn
browser/themes/pinstripe/browser/preferences/preferences.css
browser/themes/winstripe/browser/preferences/preferences.css
toolkit/mozapps/jar.mn
toolkit/mozapps/preferences/actionsshared.js
--- a/browser/components/feeds/public/nsIWebContentConverterRegistrar.idl
+++ b/browser/components/feeds/public/nsIWebContentConverterRegistrar.idl
@@ -31,55 +31,42 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
+#include "nsIMIMEInfo.idl"
 
 interface nsIRequest;
 
-[scriptable, uuid(2bd97d63-e928-4d52-9fd4-34061349a9a6)]
-interface nsIWebContentHandlerInfo : nsISupports
+[scriptable, uuid(eb361098-5158-4b21-8f98-50b445f1f0b2)]
+interface nsIWebContentHandlerInfo : nsIHandlerApp
 {
   /**
    * The content type handled by the handler
    */
   readonly attribute AString contentType;
 
   /**
    * The uri of the handler, with an embedded %s where the URI of the loaded
    * document will be encoded.
    */
   readonly attribute AString uri;
 
-  /**
-   * A human readable title of the handler.
-   */
-  readonly attribute AString name;
-
   /** 
    * Gets the service URL Spec, with the loading document URI encoded in it.
    * @param   uri
    *          The URI of the document being loaded
    * @returns The URI of the service with the loading document URI encoded in 
    *          it.
    */
   AString getHandlerURI(in AString uri);
-
-  /**
-   * Determines if this handler object is equivalent to another.
-   * @param   other
-   *          The other handler info object
-   * @returns true if the two objects are equivalent (same content type, 
-   *          same uri).
-   */
-  boolean equals(in nsIWebContentHandlerInfo other);
 };
 
 [scriptable, uuid(632b16a8-5c6b-4dc5-a8db-01771af7a79d)]
 interface nsIWebContentConverterService : nsISupports
 {
   /**
    * Specifies the handler to be used to automatically handle all links of a
    * certain content type from now on. 
--- a/browser/components/feeds/src/WebContentConverter.js
+++ b/browser/components/feeds/src/WebContentConverter.js
@@ -106,51 +106,58 @@ var WebContentConverterFactory = {
 
 function ServiceInfo(contentType, uri, name) {
   this._contentType = contentType;
   this._uri = uri;
   this._name = name;
 }
 ServiceInfo.prototype = {
   /**
+   * See nsIHandlerApp
+   */
+  get name() {
+    return this._name;
+  },
+  
+  /**
+   * See nsIHandlerApp
+   */
+  equals: function SI_equals(aHandlerApp) {
+    if (!aHandlerApp)
+      throw Cr.NS_ERROR_NULL_POINTER;
+
+    if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo &&
+        aHandlerApp.contentType == this.contentType &&
+        aHandlerApp.uri == this.uri)
+      return true;
+
+    return false;
+  },
+
+  /**
    * See nsIWebContentHandlerInfo
    */
   get contentType() {
     return this._contentType;
   },
 
   /**
    * See nsIWebContentHandlerInfo
    */
   get uri() {
     return this._uri;
   },
 
   /**
    * See nsIWebContentHandlerInfo
    */
-  get name() {
-    return this._name;
-  },
-  
-  /**
-   * See nsIWebContentHandlerInfo
-   */
   getHandlerURI: function SI_getHandlerURI(uri) {
     return this._uri.replace(/%s/gi, encodeURIComponent(uri));
   },
   
-  /**
-   * See nsIWebContentHandlerInfo
-   */
-  equals: function SI_equals(other) {
-    return this.contentType == other.contentType &&
-           this.uri == other.uri;
-  },
-  
   QueryInterface: function SI_QueryInterface(iid) {
     if (iid.equals(Ci.nsIWebContentHandlerInfo) ||
         iid.equals(Ci.nsISupports))
       return this;
     throw Cr.NS_ERROR_NO_INTERFACE;
   }
 };
 
new file mode 100755
--- /dev/null
+++ b/browser/components/preferences/applications.js
@@ -0,0 +1,1513 @@
+/*
+# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Download Actions Manager.
+#
+# The Initial Developer of the Original Code is
+# Ben Goodger.
+# Portions created by the Initial Developer are Copyright (C) 2000
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Ben Goodger <ben@mozilla.org>
+#   Jeff Walden <jwalden+code@mit.edu>
+#   Asaf Romano <mozilla.mano@sent.com>
+#   Myk Melez <myk@mozilla.org>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+ */
+
+//****************************************************************************//
+// Constants & Enumeration Values
+
+/*
+#ifndef XP_MACOSX
+*/
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cr = Components.results;
+var TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
+const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+/*
+#endif
+*/
+
+const PREF_DISABLED_PLUGIN_TYPES = "plugin.disable_full_page_plugin_for_types";
+
+// Preferences that affect which entries to show in the list.
+const PREF_SHOW_PLUGINS_IN_LIST = "browser.download.show_plugins_in_list";
+const PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS =
+  "browser.download.hide_plugins_without_extensions";
+
+/*
+ * Preferences where we store handling information about the feed type.
+ *
+ * browser.feeds.handler
+ * - "bookmarks", "reader" (clarified further using the .default preference),
+ *   or "ask" -- indicates the default handler being used to process feeds;
+ *   "bookmarks" is obsolete; to specify that the handler is bookmarks,
+ *   set browser.feeds.handler.default to "bookmarks";
+ *
+ * browser.feeds.handler.default
+ * - "bookmarks", "client" or "web" -- indicates the chosen feed reader used
+ *   to display feeds, either transiently (i.e., when the "use as default"
+ *   checkbox is unchecked, corresponds to when browser.feeds.handler=="ask")
+ *   or more permanently (i.e., the item displayed in the dropdown in Feeds
+ *   preferences)
+ *
+ * browser.feeds.handler.webservice
+ * - the URL of the currently selected web service used to read feeds
+ *
+ * browser.feeds.handlers.application
+ * - nsILocalFile, stores the current client-side feed reading app if one has
+ *   been chosen
+ */
+const PREF_FEED_SELECTED_APP    = "browser.feeds.handlers.application";
+const PREF_FEED_SELECTED_WEB    = "browser.feeds.handlers.webservice";
+const PREF_FEED_SELECTED_ACTION = "browser.feeds.handler";
+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;
+
+
+//****************************************************************************//
+// Utilities
+
+function getDisplayNameForFile(aFile) {
+/*
+#ifdef XP_WIN
+*/
+  if (aFile instanceof Ci.nsILocalFileWin) {
+    try {
+      return aFile.getVersionInfoField("FileDescription"); 
+    }
+    catch(ex) {
+      // fall through to the file name
+    }
+  }
+/*
+#endif
+#ifdef XP_MACOSX
+*/
+  if (aFile instanceof Ci.nsILocalFileMac) {
+    try {
+      return aFile.bundleDisplayName;
+    }
+    catch(ex) {
+      // fall through to the file name
+    }
+  }
+/*
+#endif
+*/
+
+  return Cc["@mozilla.org/network/io-service;1"].
+         getService(Ci.nsIIOService).
+         newFileURI(aFile).
+         QueryInterface(Ci.nsIURL).
+         fileName;
+}
+
+function getLocalHandlerApp(aFile) {
+  var localHandlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
+                        createInstance(Ci.nsILocalHandlerApp);
+  localHandlerApp.name = getDisplayNameForFile(aFile);
+  localHandlerApp.executable = aFile;
+
+  return localHandlerApp;
+}
+
+
+//****************************************************************************//
+// HandlerInfoWrapper
+
+/**
+ * This object wraps nsIHandlerInfo with some additional functionality
+ * the Applications prefpane needs to display and allow modification of
+ * the list of handled types.
+ * 
+ * We create an instance of this wrapper for each entry we might display
+ * in the prefpane, and we compose the instances from various sources,
+ * including navigator.plugins and the handler service.
+ *
+ * We don't implement all the original nsIHandlerInfo functionality,
+ * just the stuff that the prefpane needs.
+ * 
+ * In theory, all of the custom functionality in this wrapper should get
+ * pushed down into nsIHandlerInfo eventually.
+ */
+function HandlerInfoWrapper(aType, aHandlerInfo) {
+  this._type = aType;
+  this.wrappedHandlerInfo = aHandlerInfo;
+}
+
+HandlerInfoWrapper.prototype = {
+  // The wrapped nsIHandlerInfo object.  In general, this object is private,
+  // but there are a couple cases where callers access it directly for things
+  // we haven't (yet?) implemented, so we make it a public property.
+  wrappedHandlerInfo: null,
+
+  //**************************************************************************//
+  // Convenience Utils
+
+  _handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"].
+               getService(Ci.nsIHandlerService),
+
+  // Retrieve this as nsIPrefBranch and then immediately QI to nsIPrefBranch2
+  // so both interfaces are available to callers.
+  _prefSvc: Cc["@mozilla.org/preferences-service;1"].
+            getService(Ci.nsIPrefBranch).
+            QueryInterface(Ci.nsIPrefBranch2),
+
+  _categoryMgr: Cc["@mozilla.org/categorymanager;1"].
+                getService(Ci.nsICategoryManager),
+
+  element: function(aID) {
+    return document.getElementById(aID);
+  },
+
+
+  //**************************************************************************//
+  // nsISupports
+
+  QueryInterface: function(aIID) {
+    if (aIID.equals(Ci.nsIHandlerInfo) ||
+        aIID.equals(Ci.nsISupports) ||
+        (aIID.equals(Ci.nsIMIMEInfo) &&
+         this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo))
+      return this;
+
+    throw Cr.NS_ERROR_NO_INTERFACE;
+  },
+
+
+  //**************************************************************************//
+  // nsIHandlerInfo
+
+  // The MIME type or protocol scheme.
+  _type: null,
+  get type() {
+    return this._type;
+  },
+
+  get description() {
+    if (this.wrappedHandlerInfo.description)
+      return this.wrappedHandlerInfo.description;
+
+    if (this.primaryExtension) {
+      let bundle = this.element("bundlePreferences");
+      var extension = this.primaryExtension.toUpperCase();
+      return bundle.getFormattedString("fileEnding", [extension]);
+    }
+
+    return this.type;
+  },
+
+  get preferredApplicationHandler() {
+    return this.wrappedHandlerInfo.preferredApplicationHandler;
+  },
+
+  set preferredApplicationHandler(aNewValue) {
+    this.wrappedHandlerInfo.preferredApplicationHandler = aNewValue;
+
+    // Make sure the preferred handler is in the set of possible handlers.
+    if (aNewValue) {
+      var found = false;
+      var possibleApps = this.possibleApplicationHandlers.
+                         QueryInterface(Ci.nsIArray).enumerate();
+      while (possibleApps.hasMoreElements() && !found)
+        found = possibleApps.getNext().equals(aNewValue);
+      if (!found)
+        this.possibleApplicationHandlers.appendElement(aNewValue, false);
+    }
+  },
+
+  get possibleApplicationHandlers() {
+    return this.wrappedHandlerInfo.possibleApplicationHandlers;
+  },
+
+  get hasDefaultHandler() {
+    return this.wrappedHandlerInfo.hasDefaultHandler;
+  },
+
+  get defaultDescription() {
+    return this.wrappedHandlerInfo.defaultDescription;
+  },
+
+  // What to do with content of this type.
+  get preferredAction() {
+    // If we have an enabled plugin, then the action is to use that plugin.
+    if (this.plugin && !this.isDisabledPluginType)
+      return kActionUsePlugin;
+
+    // XXX nsIMIMEService::getFromTypeAndExtension returns handler infos
+    // whose default action is saveToDisk; should we do that here too?
+    // And will there ever be handler info objects with no preferred action?
+    if (!this.wrappedHandlerInfo.preferredAction) {
+      if (gApplicationsPane.isValidHandlerApp(this.preferredApplicationHandler))
+        return Ci.nsIHandlerInfo.useHelperApp;
+      else
+        return Ci.nsIHandlerInfo.useSystemDefault;
+    }
+
+    // If the action is to use a helper app, but we don't have a preferred
+    // helper app, switch to using the system default.
+    if (this.wrappedHandlerInfo.preferredAction == Ci.nsIHandlerInfo.useHelperApp &&
+        !gApplicationsPane.isValidHandlerApp(this.preferredApplicationHandler))
+      return Ci.nsIHandlerInfo.useSystemDefault;
+
+    return this.wrappedHandlerInfo.preferredAction;
+  },
+
+  set preferredAction(aNewValue) {
+    // We don't modify the preferred action if the new action is to use a plugin
+    // because handler info objects don't understand our custom "use plugin"
+    // value.  Also, leaving it untouched means that we can automatically revert
+    // to the old setting if the user ever removes the plugin.
+
+    if (aNewValue != kActionUsePlugin)
+      this.wrappedHandlerInfo.preferredAction = aNewValue;
+  },
+
+  get alwaysAskBeforeHandling() {
+    // If this type is handled only by a plugin, we can't trust the value
+    // in the handler info object, since it'll be a default based on the absence
+    // of any user configuration, and the default in that case is to always ask,
+    // even though we never ask for content handled by a plugin, so special case
+    // plugin-handled types by returning false here.
+    if (this.plugin && this.handledOnlyByPlugin)
+      return false;
+
+    return this.wrappedHandlerInfo.alwaysAskBeforeHandling;
+  },
+
+  set alwaysAskBeforeHandling(aNewValue) {
+    this.wrappedHandlerInfo.alwaysAskBeforeHandling = aNewValue;
+  },
+
+
+  //**************************************************************************//
+  // nsIMIMEInfo
+
+  // The primary file extension associated with this type, if any.
+  //
+  // XXX Plugin objects contain an array of MimeType objects with "suffixes"
+  // properties; if this object has an associated plugin, shouldn't we check
+  // those properties for an extension?
+  get primaryExtension() {
+    try {
+      if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
+          this.wrappedHandlerInfo.primaryExtension)
+        return this.wrappedHandlerInfo.primaryExtension
+    } catch(ex) {}
+
+    return null;
+  },
+
+
+  //**************************************************************************//
+  // Plugin Handling
+
+  // A plugin that can handle this type, if any.
+  //
+  // Note: just because we have one doesn't mean it *will* handle the type.
+  // That depends on whether or not the type is in the list of types for which
+  // plugin handling is disabled.
+  plugin: null,
+
+  // Whether or not this type is only handled by a plugin or is also handled
+  // by some user-configured action as specified in the handler info object.
+  //
+  // Note: we can't just check if there's a handler info object for this type,
+  // because OS and user configuration is mixed up in the handler info object,
+  // so we always need to retrieve it for the OS info and can't tell whether
+  // it represents only OS-default information or user-configured information.
+  //
+  // FIXME: once handler info records are broken up into OS-provided records
+  // and user-configured records, stop using this boolean flag and simply
+  // check for the presence of a user-configured record to determine whether
+  // or not this type is only handled by a plugin.  Filed as bug 395142.
+  handledOnlyByPlugin: undefined,
+
+  get isDisabledPluginType() {
+    return this._getDisabledPluginTypes().indexOf(this.type) != -1;
+  },
+
+  _getDisabledPluginTypes: function() {
+    var types = "";
+
+    if (this._prefSvc.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES))
+      types = this._prefSvc.getCharPref(PREF_DISABLED_PLUGIN_TYPES);
+
+    // Only split if the string isn't empty so we don't end up with an array
+    // containing a single empty string.
+    if (types != "")
+      return types.split(",");
+
+    return [];
+  },
+
+  disablePluginType: function() {
+    var disabledPluginTypes = this._getDisabledPluginTypes();
+
+    if (disabledPluginTypes.indexOf(this.type) == -1)
+      disabledPluginTypes.push(this.type);
+
+    this._prefSvc.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
+                              disabledPluginTypes.join(","));
+
+    // Update the category manager so existing browser windows update.
+    this._categoryMgr.deleteCategoryEntry("Gecko-Content-Viewers",
+                                          this.type,
+                                          false);
+  },
+
+  enablePluginType: function() {
+    var disabledPluginTypes = this._getDisabledPluginTypes();
+
+    var type = this.type;
+    disabledPluginTypes = disabledPluginTypes.filter(function(v) v != type);
+
+    this._prefSvc.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
+                              disabledPluginTypes.join(","));
+
+    // Update the category manager so existing browser windows update.
+    this._categoryMgr.
+      addCategoryEntry("Gecko-Content-Viewers",
+                       this.type,
+                       "@mozilla.org/content/plugin/document-loader-factory;1",
+                       false,
+                       true);
+  },
+
+
+  //**************************************************************************//
+  // Storage
+
+  store: function() {
+    this._handlerSvc.store(this.wrappedHandlerInfo);
+  },
+
+  remove: function() {
+    this._handlerSvc.remove(this.wrappedHandlerInfo);
+  },
+
+
+  //**************************************************************************//
+  // Icons
+
+  get smallIcon() {
+    return this._getIcon(16);
+  },
+
+  get largeIcon() {
+    return this._getIcon(32);
+  },
+
+  _getIcon: function(aSize) {
+    if (this.primaryExtension)
+      return "moz-icon://goat." + this.primaryExtension + "?size=" + aSize;
+
+    if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo)
+      return "moz-icon://goat?size=" + aSize + "&contentType=" + this.type;
+
+    // FIXME: consider returning some generic icon when we can't get a URL for
+    // one (for example in the case of protocol schemes).  Filed as bug 395141.
+    return null;
+  }
+
+};
+
+
+//****************************************************************************//
+// Feed Handler Info
+
+/**
+ * This object implements nsIHandlerInfo for the feed type.  It's a separate
+ * object because we currently store handling information for the feed type
+ * in a set of preferences rather than the nsIHandlerService-managed datastore.
+ * 
+ * This object inherits from HandlerInfoWrapper in order to get functionality
+ * that isn't special to the feed type.
+ * 
+ * XXX Should we inherit from HandlerInfoWrapper?  After all, we override
+ * most of that wrapper's properties and methods, and we have to dance around
+ * the fact that the wrapper expects to have a wrappedHandlerInfo, which we
+ * don't provide.
+ */
+var feedHandlerInfo = {
+
+  __proto__: new HandlerInfoWrapper(TYPE_MAYBE_FEED, null),
+
+
+  //**************************************************************************//
+  // Convenience Utils
+
+  _converterSvc:
+    Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
+    getService(Ci.nsIWebContentConverterService),
+
+  _shellSvc: Cc["@mozilla.org/browser/shell-service;1"].
+             getService(Ci.nsIShellService),
+
+
+  //**************************************************************************//
+  // nsIHandlerInfo
+
+  get description() {
+    return gApplicationsPane._bundle.getString("webFeed");
+  },
+
+  get preferredApplicationHandler() {
+    switch (this.element(PREF_FEED_SELECTED_READER).value) {
+      case "client":
+        var file = this.element(PREF_FEED_SELECTED_APP).value;
+        if (file)
+          return getLocalHandlerApp(file);
+
+        return null;
+
+      case "web":
+        var uri = this.element(PREF_FEED_SELECTED_WEB).value;
+        if (!uri)
+          return null;
+        return this._converterSvc.getWebContentHandlerByURI(TYPE_MAYBE_FEED,
+                                                            uri);
+
+      case "bookmarks":
+      default:
+        // When the pref is set to bookmarks, we handle feeds internally,
+        // we don't forward them to a local or web handler app, so there is
+        // no preferred handler.
+        return null;
+    }
+  },
+
+  set preferredApplicationHandler(aNewValue) {
+    if (aNewValue instanceof Ci.nsILocalHandlerApp) {
+      this.element(PREF_FEED_SELECTED_APP).value = aNewValue.executable;
+      this.element(PREF_FEED_SELECTED_READER).value = "client";
+    }
+    else if (aNewValue instanceof Ci.nsIWebContentHandlerInfo) {
+      this.element(PREF_FEED_SELECTED_WEB).value = aNewValue.uri;
+      this.element(PREF_FEED_SELECTED_READER).value = "web";
+      // Make the web handler be the new "auto handler" for feeds.
+      // Note: we don't have to unregister the auto handler when the user picks
+      // a non-web handler (local app, Live Bookmarks, etc.) because the service
+      // only uses the "auto handler" when the selected reader is a web handler.
+      // We also don't have to unregister it when the user turns on "always ask"
+      // (i.e. preview in browser), since that also overrides the auto handler.
+      this._converterSvc.setAutoHandler(this.type, aNewValue);
+    }
+  },
+
+  get possibleApplicationHandlers() {
+    var handlerApps = Cc["@mozilla.org/array;1"].
+                      createInstance(Ci.nsIMutableArray);
+
+    // Add the "selected" local application, if there is one and it's different
+    // from the default handler for the OS.  Unlike for other types, there can
+    // be only one of these at a time for the feed type, since feed preferences
+    // only store a single local app.
+    var preferredAppFile = this.element(PREF_FEED_SELECTED_APP).value;
+    if (preferredAppFile && preferredAppFile.exists()) {
+      let preferredApp = getLocalHandlerApp(preferredAppFile);
+      let defaultApp = this._defaultApplicationHandler;
+      if (!defaultApp || !defaultApp.equals(preferredApp))
+        handlerApps.appendElement(preferredApp, false);
+    }
+
+    // Add the registered web handlers.  There can be any number of these.
+    var webHandlers = this._converterSvc.getContentHandlers(this.type, {});
+    for each (let webHandler in webHandlers)
+      handlerApps.appendElement(webHandler, false);
+
+    return handlerApps;
+  },
+
+  __defaultApplicationHandler: undefined,
+  get _defaultApplicationHandler() {
+    if (typeof this.__defaultApplicationHandler != "undefined")
+      return this.__defaultApplicationHandler;
+
+    var defaultFeedReader;
+    try {
+      defaultFeedReader = this._shellSvc.defaultFeedReader;
+    }
+    catch(ex) {
+      // no default reader
+    }
+
+    if (defaultFeedReader) {
+      let handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
+                       createInstance(Ci.nsIHandlerApp);
+      handlerApp.name = getDisplayNameForFile(defaultFeedReader);
+      handlerApp.QueryInterface(Ci.nsILocalHandlerApp);
+      handlerApp.executable = defaultFeedReader;
+
+      this.__defaultApplicationHandler = handlerApp;
+    }
+    else {
+      this.__defaultApplicationHandler = null;
+    }
+
+    return this.__defaultApplicationHandler;
+  },
+
+  get hasDefaultHandler() {
+    try {
+      if (this._shellSvc.defaultFeedReader)
+        return true;
+    }
+    catch(ex) {
+      // no default reader
+    }
+
+    return false;
+  },
+
+  get defaultDescription() {
+    if (this.hasDefaultHandler)
+      return this._defaultApplicationHandler.name;
+
+    // Should we instead return null?
+    return "";
+  },
+
+  // What to do with content of this type.
+  get preferredAction() {
+    switch (this.element(PREF_FEED_SELECTED_ACTION).value) {
+
+      case "bookmarks":
+        return Ci.nsIHandlerInfo.handleInternally;
+
+      case "reader":
+        let preferredApp = this.preferredApplicationHandler;
+        let defaultApp = this._defaultApplicationHandler;
+
+        // If we have a valid preferred app, return useSystemDefault if it's
+        // the default app; otherwise return useHelperApp.
+        if (gApplicationsPane.isValidHandlerApp(preferredApp)) {
+          if (defaultApp && defaultApp.equals(preferredApp))
+            return Ci.nsIHandlerInfo.useSystemDefault;
+
+          return Ci.nsIHandlerInfo.useHelperApp;
+        }
+
+        // The pref is set to "reader", but we don't have a valid preferred app.
+        // What do we do now?  Not sure this is the best option (perhaps we
+        // should direct the user to the default app, if any), but for now let's
+        // direct the user to live bookmarks.
+        return Ci.nsIHandlerInfo.handleInternally;
+
+      // If the action is "ask", then alwaysAskBeforeHandling will override
+      // the action, so it doesn't matter what we say it is, it just has to be
+      // something that doesn't cause the controller to hide the type.
+      case "ask":
+      default:
+        return Ci.nsIHandlerInfo.handleInternally;
+    }
+  },
+
+  set preferredAction(aNewValue) {
+    switch (aNewValue) {
+
+      case Ci.nsIHandlerInfo.handleInternally:
+        this.element(PREF_FEED_SELECTED_READER).value = "bookmarks";
+        break;
+
+      case Ci.nsIHandlerInfo.useHelperApp:
+        this.element(PREF_FEED_SELECTED_ACTION).value = "reader";
+        // The controller has already set preferredApplicationHandler
+        // to the new helper app.
+        break;
+
+      case Ci.nsIHandlerInfo.useSystemDefault:
+        this.element(PREF_FEED_SELECTED_ACTION).value = "reader";
+        this.preferredApplicationHandler = this._defaultApplicationHandler;
+        break;
+    }
+  },
+
+  get alwaysAskBeforeHandling() {
+    return this.element(PREF_FEED_SELECTED_ACTION).value == "ask";
+  },
+
+  set alwaysAskBeforeHandling(aNewValue) {
+    if (aNewValue == true)
+      this.element(PREF_FEED_SELECTED_ACTION).value = "ask";
+    else
+      this.element(PREF_FEED_SELECTED_ACTION).value = "reader";
+  },
+
+
+  //**************************************************************************//
+  // nsIMIMEInfo
+
+  get primaryExtension() {
+    return "xml";
+  },
+
+
+  //**************************************************************************//
+  // Plugin Handling
+
+  handledOnlyByPlugin: false,
+
+
+  //**************************************************************************//
+  // Storage
+
+  // Changes to the preferred action and handler take effect immediately
+  // (we write them out to the preferences right as they happen), so we don't
+  // need to do anything when the controller calls store() after modifying
+  // the handler.
+  // XXX Should we hold off on making the changes until this method gets called?
+  store: function() {},
+
+  // The feed type cannot be removed.
+  remove: function() {},
+
+
+  //**************************************************************************//
+  // Icons
+
+  get smallIcon() {
+    return "chrome://browser/skin/feeds/feedIcon16.png";
+  },
+
+  get largeIcon() {
+    return "chrome://browser/skin/feeds/feedIcon.png";
+  }
+
+};
+
+
+//****************************************************************************//
+// Prefpane Controller
+
+var gApplicationsPane = {
+  // The set of types the app knows how to handle.  A hash of HandlerInfoWrapper
+  // objects, indexed by type.
+  _handledTypes: {},
+
+  _bundle       : null,
+  _list         : null,
+  _filter       : null,
+
+  // Retrieve this as nsIPrefBranch and then immediately QI to nsIPrefBranch2
+  // so both interfaces are available to callers.
+  _prefSvc      : Cc["@mozilla.org/preferences-service;1"].
+                  getService(Ci.nsIPrefBranch).
+                  QueryInterface(Ci.nsIPrefBranch2),
+
+  _mimeSvc      : Cc["@mozilla.org/uriloader/external-helper-app-service;1"].
+                  getService(Ci.nsIMIMEService),
+
+  _helperAppSvc : Cc["@mozilla.org/uriloader/external-helper-app-service;1"].
+                  getService(Ci.nsIExternalHelperAppService),
+
+  _handlerSvc   : Cc["@mozilla.org/uriloader/handler-service;1"].
+                  getService(Ci.nsIHandlerService),
+
+  _ioSvc        : Cc["@mozilla.org/network/io-service;1"].
+                  getService(Ci.nsIIOService),
+
+
+  //**************************************************************************//
+  // Initialization & Destruction
+
+  init: function() {
+    // Initialize shortcuts to some commonly accessed elements.
+    this._bundle = document.getElementById("bundlePreferences");
+    this._list = document.getElementById("handlersView");
+    this._filter = document.getElementById("filter");
+
+    // Observe preferences that influence what we display so we can rebuild
+    // the view when they change.
+    this._prefSvc.addObserver(PREF_SHOW_PLUGINS_IN_LIST, this, false);
+    this._prefSvc.addObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this, false);
+    this._prefSvc.addObserver(PREF_FEED_SELECTED_APP, this, false);
+    this._prefSvc.addObserver(PREF_FEED_SELECTED_WEB, this, false);
+    this._prefSvc.addObserver(PREF_FEED_SELECTED_ACTION, this, false);
+    this._prefSvc.addObserver(PREF_FEED_SELECTED_READER, this, false);
+
+    // Listen for window unload so we can remove our preference observers.
+    window.addEventListener("unload", this, false);
+
+    // Figure out how we should be sorting the list.  We persist sort settings
+    // across sessions, so we can't assume the default sort column and direction.
+    // XXX should we be using the XUL sort service instead?
+    if (document.getElementById("typeColumn").hasAttribute("sortDirection"))
+      this._sortColumn = document.getElementById("typeColumn");
+    else if (document.getElementById("actionColumn").hasAttribute("sortDirection"))
+      this._sortColumn = document.getElementById("actionColumn");
+
+    // Load the data and build the list of handlers.
+    // By doing this in a timeout, we let the preferences dialog resize itself
+    // to an appropriate size before we add a bunch of items to the list.
+    // Otherwise, if there are many items, and the Applications prefpane
+    // is the one that gets displayed when the user first opens the dialog,
+    // the dialog might stretch too much in an attempt to fit them all in.
+    // XXX Shouldn't we perhaps just set a max-height on the richlistbox?
+    var _delayedPaneLoad = function(self) {
+      self._loadData();
+      self.rebuildView();
+      self._list.focus();
+    }
+    setTimeout(_delayedPaneLoad, 0, this);
+  },
+
+  destroy: function() {
+    window.removeEventListener("unload", this, false);
+    this._prefSvc.removeObserver(PREF_SHOW_PLUGINS_IN_LIST, this);
+    this._prefSvc.removeObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this);
+    this._prefSvc.removeObserver(PREF_FEED_SELECTED_APP, this);
+    this._prefSvc.removeObserver(PREF_FEED_SELECTED_WEB, this);
+    this._prefSvc.removeObserver(PREF_FEED_SELECTED_ACTION, this);
+    this._prefSvc.removeObserver(PREF_FEED_SELECTED_READER, this);
+  },
+
+
+  //**************************************************************************//
+  // nsISupports
+
+  QueryInterface: function(aIID) {
+    if (aIID.equals(Ci.nsIObserver) ||
+        aIID.equals(Ci.nsIDOMEventListener ||
+        aIID.equals(Ci.nsISupports)))
+      return this;
+
+    throw Cr.NS_ERROR_NO_INTERFACE;
+  },
+
+
+  //**************************************************************************//
+  // nsIObserver
+
+  observe: function (aSubject, aTopic, aData) {
+    // Rebuild the list when there are changes to preferences that influence
+    // whether or not to show certain entries in the list.
+    if (aTopic == "nsPref:changed")
+      this.rebuildView();
+  },
+
+
+  //**************************************************************************//
+  // nsIDOMEventListener
+
+  handleEvent: function(aEvent) {
+    if (aEvent.type == "unload") {
+      this.destroy();
+    }
+  },
+
+
+  //**************************************************************************//
+  // Composed Model Construction
+
+  _loadData: function() {
+    this._loadFeedHandler();
+    this._loadPluginHandlers();
+    this._loadApplicationHandlers();
+  },
+
+  _loadFeedHandler: function() {
+    this._handledTypes[TYPE_MAYBE_FEED] = feedHandlerInfo;
+  },
+
+  /**
+   * Load the set of handlers defined by plugins.
+   *
+   * Note: if there's more than one plugin for a given MIME type, we assume
+   * the last one is the one that the application will use.  That may not be
+   * correct, but it's how we've been doing it for years.
+   *
+   * Perhaps we should instead query navigator.mimeTypes for the set of types
+   * supported by the application and then get the plugin from each MIME type's
+   * enabledPlugin property.  But if there's a plugin for a type, we need
+   * to know about it even if it isn't enabled, since we're going to give
+   * the user an option to enable it.
+   * 
+   * I'll also note that my reading of nsPluginTag::RegisterWithCategoryManager
+   * suggests that enabledPlugin is only determined during registration
+   * and does not get updated when plugin.disable_full_page_plugin_for_types
+   * changes (unless modification of that preference spawns reregistration).
+   * So even if we could use enabledPlugin to get the plugin that would be used,
+   * we'd still need to check the pref ourselves to find out if it's enabled.
+   */
+  _loadPluginHandlers: function() {
+    for (let i = 0; i < navigator.plugins.length; ++i) {
+      let plugin = navigator.plugins[i];
+      for (let j = 0; j < plugin.length; ++j) {
+        let type = plugin[j].type;
+        let handlerInfoWrapper;
+
+        if (typeof this._handledTypes[type] == "undefined") {
+          let wrappedHandlerInfo =
+            this._mimeSvc.getFromTypeAndExtension(type, null);
+          handlerInfoWrapper = new HandlerInfoWrapper(type, wrappedHandlerInfo);
+          this._handledTypes[type] = handlerInfoWrapper;
+        }
+        else
+          handlerInfoWrapper = this._handledTypes[type];
+
+        handlerInfoWrapper.plugin = plugin;
+        handlerInfoWrapper.handledOnlyByPlugin = true;
+      }
+    }
+  },
+
+  /**
+   * Load the set of handlers defined by the application datastore.
+   */
+  _loadApplicationHandlers: function() {
+    var wrappedHandlerInfos = this._handlerSvc.enumerate();
+    while (wrappedHandlerInfos.hasMoreElements()) {
+      let wrappedHandlerInfo = wrappedHandlerInfos.getNext().
+                               QueryInterface(Ci.nsIHandlerInfo);
+      let type = wrappedHandlerInfo.type;
+      let handlerInfoWrapper;
+
+      if (typeof this._handledTypes[type] == "undefined") {
+        handlerInfoWrapper = new HandlerInfoWrapper(type, wrappedHandlerInfo);
+        this._handledTypes[type] = handlerInfoWrapper;
+      }
+      else
+        handlerInfoWrapper = this._handledTypes[type];
+
+      handlerInfoWrapper.handledOnlyByPlugin = false;
+    }
+  },
+
+
+  //**************************************************************************//
+  // View Construction
+
+  rebuildView: function() {
+    // Clear the list of entries.
+    while (this._list.childNodes.length > 1)
+      this._list.removeChild(this._list.lastChild);
+
+    var visibleTypes = this._getVisibleTypes();
+
+    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);
+      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;
+    }
+  },
+
+  _getVisibleTypes: function() {
+    var visibleTypes = [];
+
+    var showPlugins = this._prefSvc.getBoolPref(PREF_SHOW_PLUGINS_IN_LIST);
+    var hideTypesWithoutExtensions =
+      this._prefSvc.getBoolPref(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS);
+
+    for (let type in this._handledTypes) {
+      let handlerInfo = this._handledTypes[type];
+
+      // Hide types without extensions if so prefed so we don't show a whole
+      // bunch of obscure types handled by plugins on Mac.
+      // Note: though protocol types don't have extensions, we still show them;
+      // the pref is only meant to be applied to MIME types.
+      // FIXME: if the type has a plugin, should we also check the "suffixes"
+      // property of the plugin?  Filed as bug 395135.
+      if (hideTypesWithoutExtensions &&
+          handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
+          !handlerInfo.primaryExtension)
+        continue;
+
+      // Hide types handled only by plugins if so prefed.
+      if (handlerInfo.handledOnlyByPlugin && !showPlugins)
+        continue;
+
+      // Hide types handled only by disabled plugins.
+      // FIXME: we should show these types to give the user a chance to reenable
+      // the plugins.  Filed as bug 395136.
+      if (handlerInfo.handledOnlyByPlugin && handlerInfo.isDisabledPluginType)
+        continue;
+
+      // Don't display entries for types we always ask about before handling.
+      // FIXME: that's what the old code did, but we should be showing these
+      // types and letting users choose to do something different.  Filed as
+      // bug 395138.
+      if (handlerInfo.alwaysAskBeforeHandling &&
+          handlerInfo.type != TYPE_MAYBE_FEED)
+        continue;
+
+      // If the user is filtering the list, then only show matching types.
+      if (this._filter.value && !this._matchesFilter(handlerInfo))
+        continue;
+
+      // We couldn't find any reason to exclude the type, so include it.
+      visibleTypes.push(handlerInfo);
+    }
+
+    return visibleTypes;
+  },
+
+  // FIXME: we filter on type and primary extension, but we don't show those
+  // values to users, unlike the description and action description, which we
+  // do show, and that could be confusing, so filter only on the values we show.
+  // Filed as bug 395139.
+  _matchesFilter: function(aType) {
+    var filterValue = this._filter.value.toLowerCase();
+    return aType.description.toLowerCase().indexOf(filterValue) != -1 ||
+           this._describePreferredAction(aType).toLowerCase().indexOf(filterValue) != -1 ||
+           aType.type.toLowerCase().indexOf(filterValue) != -1 ||
+           (aType.primaryExtension &&
+            aType.primaryExtension.toLowerCase().indexOf(filterValue) != -1);
+  },
+
+  /**
+   * Describe, in a human-readable fashion, the preferred action to take on
+   * the type represented by the given handler info object.
+   *
+   * XXX Should this be part of the HandlerInfoWrapper interface?  It would
+   * violate the separation of model and view, but it might make more sense
+   * nonetheless (f.e. it would make sortTypes easier).
+   *
+   * @param aHandlerInfo {nsIHandlerInfo} the type whose preferred action
+   *                                      is being described
+   */
+  _describePreferredAction: function(aHandlerInfo) {
+    // alwaysAskBeforeHandling overrides the preferred action, so if that flag
+    // is set, then describe that behavior instead.  Currently we hide all types
+    // with alwaysAskBeforeHandling except for the feed type, so here we use
+    // a feed-specific message to describe the behavior.
+    if (aHandlerInfo.alwaysAskBeforeHandling)
+      return this._bundle.getString("alwaysAskAboutFeed");
+
+    switch (aHandlerInfo.preferredAction) {
+      case Ci.nsIHandlerInfo.saveToDisk:
+        return this._bundle.getString("saveToDisk");
+
+      case Ci.nsIHandlerInfo.useHelperApp:
+        return aHandlerInfo.preferredApplicationHandler.name;
+
+      case Ci.nsIHandlerInfo.handleInternally:
+        // For the feed type, handleInternally means live bookmarks.
+        if (aHandlerInfo.type == TYPE_MAYBE_FEED)
+          return this._bundle.getString("liveBookmarks");
+
+        // For other types, handleInternally looks like either useHelperApp
+        // or useSystemDefault depending on whether or not there's a preferred
+        // handler app.
+        if (this.isValidHandlerApp(aHandlerInfo.preferredApplicationHandler))
+          return aHandlerInfo.preferredApplicationHandler.name;
+
+        return aHandlerInfo.defaultDescription;
+
+        // XXX Why don't we say the app will handle the type internally?
+        // Is it because the app can't actually do that?  But if that's true,
+        // then why would a preferredAction ever get set to this value
+        // in the first place?
+
+      case Ci.nsIHandlerInfo.useSystemDefault:
+        return aHandlerInfo.defaultDescription;
+
+      case kActionUsePlugin:
+        return aHandlerInfo.plugin.name;
+    }
+  },
+
+  /**
+   * Whether or not the given handler app is valid.
+   *
+   * @param aHandlerApp {nsIHandlerApp} the handler app in question
+   *
+   * @returns {boolean} whether or not it's valid
+   */
+  isValidHandlerApp: function(aHandlerApp) {
+    if (!aHandlerApp)
+      return false;
+
+    if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
+      return aHandlerApp.executable &&
+             aHandlerApp.executable.exists() &&
+             aHandlerApp.executable.isExecutable();
+
+    if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
+      return aHandlerApp.uriTemplate;
+
+    if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
+      return aHandlerApp.uri;
+
+    return false;
+  },
+
+  /**
+   * Rebuild the actions menu for the selected entry.  Gets called by
+   * the richlistitem constructor when an entry in the list gets selected.
+   */
+  rebuildActionsMenu: function() {
+    var typeItem = this._list.selectedItem;
+    var handlerInfo = this._handledTypes[typeItem.type];
+    var menu =
+      document.getAnonymousElementByAttribute(typeItem, "class", "actionsMenu");
+    var menuPopup = menu.firstChild;
+
+    // Clear out existing items.
+    while (menuPopup.hasChildNodes())
+      menuPopup.removeChild(menuPopup.lastChild);
+
+    // If this is the feed type, add "always ask" and "live bookmarks" items.
+    if (handlerInfo.type == TYPE_MAYBE_FEED) {
+      let menuItem = document.createElementNS(kXULNS, "menuitem");
+      menuItem.setAttribute("alwaysAsk", "true");
+      menuItem.setAttribute("label", this._bundle.getString("alwaysAskAboutFeed"));
+      menuPopup.appendChild(menuItem);
+      if (handlerInfo.alwaysAskBeforeHandling)
+        menu.selectedItem = menuItem;
+
+      menuItem = document.createElementNS(kXULNS, "menuitem");
+      menuItem.setAttribute("action", Ci.nsIHandlerInfo.handleInternally);
+      menuItem.setAttribute("label", this._bundle.getString("liveBookmarks"));
+      menuItem.setAttribute("image", "chrome://browser/skin/page-livemarks.png");
+      menuPopup.appendChild(menuItem);
+      if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.handleInternally)
+        menu.selectedItem = 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);
+      }
+
+      menuPopup.appendChild(menuItem);
+      if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.useSystemDefault)
+        menu.selectedItem = menuItem;
+    }
+
+    // Create menu items for possible handlers.
+    let preferredApp = handlerInfo.preferredApplicationHandler;
+    let possibleApps = handlerInfo.possibleApplicationHandlers.
+                       QueryInterface(Ci.nsIArray).enumerate();
+    while (possibleApps.hasMoreElements()) {
+      let possibleApp = possibleApps.getNext();
+      if (!this.isValidHandlerApp(possibleApp))
+        continue;
+
+      let menuItem = document.createElementNS(kXULNS, "menuitem");
+      menuItem.setAttribute("action", Ci.nsIHandlerInfo.useHelperApp);
+      menuItem.setAttribute("label", possibleApp.name);
+      menuItem.setAttribute("image", this._getIconURLForHandlerApp(possibleApp));
+
+      // Attach the handler app object to the menu item so we can use it
+      // to make changes to the datastore when the user selects the item.
+      menuItem.handlerApp = possibleApp;
+
+      menuPopup.appendChild(menuItem);
+
+      // Select this app if the preferred action is to use a helper app
+      // and this is the preferred app.
+      if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.useHelperApp &&
+          preferredApp.equals(possibleApp))
+        menu.selectedItem = menuItem;
+    }
+
+    // Create a menu item for the plugin.
+    if (handlerInfo.plugin) {
+      let menuItem = document.createElementNS(kXULNS, "menuitem");
+      menuItem.setAttribute("action", kActionUsePlugin);
+      menuItem.setAttribute("label", handlerInfo.plugin.name);
+      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
+    // available to feeds, since the feed code doesn't implement the capability.
+    // And it's not available to types handled only by plugins either, although
+    // I would think we'd want to give users the ability to redirect that stuff
+    // to disk (so maybe we should revisit that decision).
+    if ((handlerInfo instanceof Ci.nsIMIMEInfo) &&
+        handlerInfo.type != TYPE_MAYBE_FEED &&
+        !handlerInfo.handledOnlyByPlugin) {
+      let menuItem = document.createElementNS(kXULNS, "menuitem");
+      menuItem.setAttribute("action", Ci.nsIHandlerInfo.saveToDisk);
+      menuItem.setAttribute("label", this._bundle.getString("saveToDisk"));
+      menuPopup.appendChild(menuItem);
+      if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.saveToDisk)
+        menu.selectedItem = menuItem;
+    }
+
+    // Create a menu item for selecting a local application.
+    {
+      let menuItem = document.createElementNS(kXULNS, "menuitem");
+      menuItem.setAttribute("oncommand", "gApplicationsPane.chooseApp(event)");
+      menuItem.setAttribute("label", this._bundle.getString("chooseApp"));
+      menuPopup.appendChild(menuItem);
+    }
+
+    // Create a menu item for removing this entry unless it's a plugin
+    // or the feed type, which cannot be removed.
+    // XXX Should this perhaps be a button on the entry, or should we perhaps
+    // provide no UI for removing entries at all?
+    if (!handlerInfo.plugin && handlerInfo.type != TYPE_MAYBE_FEED) {
+      let menuItem = document.createElementNS(kXULNS, "menuitem");
+      menuItem.setAttribute("oncommand", "gApplicationsPane.removeType(event)");
+      menuItem.setAttribute("label", this._bundle.getString("removeType"));
+      menuPopup.appendChild(menuItem);
+    }
+  },
+
+
+  //**************************************************************************//
+  // Sorting & Filtering
+
+  _sortColumn: null,
+
+  /**
+   * Sort the list when the user clicks on a column header.
+   */
+  sort: function (event) {
+    var column = event.target;
+
+    // If the user clicked on a new sort column, remove the direction indicator
+    // from the old column.
+    if (this._sortColumn && this._sortColumn != column)
+      this._sortColumn.removeAttribute("sortDirection");
+
+    this._sortColumn = column;
+
+    // Set (or switch) the sort direction indicator.
+    if (column.getAttribute("sortDirection") == "ascending")
+      column.setAttribute("sortDirection", "descending");
+    else
+      column.setAttribute("sortDirection", "ascending");
+
+    this.rebuildView();
+  },
+
+  /**
+   * Given an array of HandlerInfoWrapper objects, sort them according to
+   * the current sort order.  Used by rebuildView to sort the set of visible
+   * types before building the list from them.
+   */
+  _sortTypes: function(aTypes) {
+    if (!this._sortColumn)
+      return;
+
+    function sortByType(a, b) {
+      return a.description.toLowerCase().localeCompare(b.description.toLowerCase());
+    }
+
+    var t = this;
+    function sortByAction(a, b) {
+      return t._describePreferredAction(a).toLowerCase().
+             localeCompare(t._describePreferredAction(b).toLowerCase());
+    }
+
+    switch (this._sortColumn.getAttribute("value")) {
+      case "type":
+        aTypes.sort(sortByType);
+        break;
+      case "action":
+        aTypes.sort(sortByAction);
+        break;
+    }
+
+    if (this._sortColumn.getAttribute("sortDirection") == "descending")
+      aTypes.reverse();
+  },
+
+  /**
+   * Filter the list when the user enters a filter term into the filter field.
+   */
+  filter: function() {
+    if (this._filter.value == "") {
+      this.clearFilter();
+      return;
+    }
+
+    this.rebuildView();
+
+    document.getElementById("filterActiveLabel").hidden = false;
+    document.getElementById("clearFilter").disabled = false;
+  },
+
+  _filterTimeout: null,
+
+  onFilterInput: function() {
+    if (this._filterTimeout)
+      clearTimeout(this._filterTimeout);
+   
+    this._filterTimeout = setTimeout("gApplicationsPane.filter()", 500);
+  },
+
+  onFilterKeyPress: function(aEvent) {
+    if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE)
+      this.clearFilter();
+  },
+  
+  clearFilter: function() {
+    this._filter.value = "";
+    this.rebuildView();
+
+    this._filter.focus();
+    document.getElementById("filterActiveLabel").hidden = true;
+    document.getElementById("clearFilter").disabled = true;
+  },
+
+  focusFilterBox: function() {
+    this._filter.focus();
+    this._filter.select();
+  },
+
+
+  //**************************************************************************//
+  // Changes
+
+  onSelectAction: function(event) {
+    var actionItem = event.originalTarget;
+    var typeItem = this._list.selectedItem;
+    var handlerInfo = this._handledTypes[typeItem.type];
+
+    if (actionItem.hasAttribute("alwaysAsk")) {
+      handlerInfo.alwaysAskBeforeHandling = true;
+    }
+    else if (actionItem.hasAttribute("action")) {
+      let action = parseInt(actionItem.getAttribute("action"));
+
+      // Set the plugin state if we're enabling or disabling a plugin.
+      if (action == kActionUsePlugin)
+        handlerInfo.enablePluginType();
+      else if (handlerInfo.plugin && !handlerInfo.isDisabledPluginType)
+        handlerInfo.disablePluginType();
+
+      // Set the preferred application handler.
+      // FIXME: consider leaving the existing preferred app in the list
+      // when we set the preferred action to something other than useHelperApp
+      // so that legacy datastores that don't have the preferred app in the list
+      // of possible apps still include the preferred app in the list of apps
+      // the user can use to handle the type.  Filed as bug 395140.
+      if (action == Ci.nsIHandlerInfo.useHelperApp)
+        handlerInfo.preferredApplicationHandler = actionItem.handlerApp;
+      else
+        handlerInfo.preferredApplicationHandler = null;
+
+      // Set the "always ask" flag.
+      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.
+    typeItem.setAttribute("actionDescription",
+                          this._describePreferredAction(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);
+    var winTitle = this._bundle.getString("fpTitleChooseApp");
+    fp.init(window, winTitle, Ci.nsIFilePicker.modeOpen);
+    fp.appendFilters(Ci.nsIFilePicker.filterApps);
+
+    if (fp.show() == Ci.nsIFilePicker.returnOK && fp.file) {
+      // XXXben - we need to compare this with the running instance executable
+      //          just don't know how to do that via script...
+      // XXXmano TBD: can probably add this to nsIShellService
+#ifdef XP_WIN
+#expand      if (fp.file.leafName == "__MOZ_APP_NAME__.exe")
+#else
+#ifdef XP_MACOSX
+#expand      if (fp.file.leafName == "__MOZ_APP_DISPLAYNAME__.app")
+#else
+#expand      if (fp.file.leafName == "__MOZ_APP_NAME__-bin")
+#endif
+#endif
+        { this.rebuildActionsMenu(); return; }
+
+      let handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
+                       createInstance(Ci.nsIHandlerApp);
+      handlerApp.name = getDisplayNameForFile(fp.file);
+      handlerApp.QueryInterface(Ci.nsILocalHandlerApp);
+      handlerApp.executable = fp.file;
+
+      var handlerInfo = this._handledTypes[this._list.selectedItem.type];
+
+      handlerInfo.preferredApplicationHandler = handlerApp;
+      handlerInfo.preferredAction = Ci.nsIHandlerInfo.useHelperApp;
+
+      handlerInfo.store();
+    }
+
+    // We rebuild the actions menu whether the user picked an app or canceled.
+    // If they picked an app, we want to add the app to the menu and select it.
+    // If they canceled, we want to go back to their previous selection.
+    this.rebuildActionsMenu();
+  },
+
+  removeType: function() {
+    var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"].
+                        getService(Ci.nsIPromptService);
+    var flags = Ci.nsIPromptService.BUTTON_TITLE_IS_STRING * Ci.nsIPromptService.BUTTON_POS_0;
+    flags += Ci.nsIPromptService.BUTTON_TITLE_CANCEL * Ci.nsIPromptService.BUTTON_POS_1;
+
+    var title = this._bundle.getString("removeTitle");
+    var message = this._bundle.getString("removeMessage");
+    var button = this._bundle.getString("removeButton");
+    var rv = promptService.confirmEx(window, title, message, flags, button, 
+                                     null, null, null, { value: 0 });
+
+    if (rv == 0) {
+      // Remove information about the type from the handlers datastore.
+      let listItem = this._list.selectedItem;
+      let handlerInfo = this._handledTypes[listItem.type];
+      handlerInfo.remove();
+
+      // Select the next item in the list (or the previous item if the item
+      // being removed is the last item).
+      if (this._list.selectedIndex == this._list.getRowCount() - 1)
+        this._list.selectedIndex = this._list.selectedIndex - 1;
+      else
+        this._list.selectedIndex = this._list.selectedIndex + 1;
+
+      // Remove the item from the list.
+      this._list.removeChild(listItem);
+    }
+    else {
+      // Rebuild the actions menu so we go back to their previous selection.
+      this.rebuildActionsMenu();
+    }
+  },
+
+  // 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;
+
+    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);
+
+    // 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);
+
+    if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
+      return this._getIconURLForWebApp(aHandlerApp.uriTemplate);
+
+    if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
+      return this._getIconURLForWebApp(aHandlerApp.uri)
+
+    // We know nothing about other kinds of handler apps.
+    return "";
+  },
+
+  _getIconURLForFile: function(aFile) {
+    var fph = this._ioSvc.getProtocolHandler("file").
+              QueryInterface(Ci.nsIFileProtocolHandler);
+    var urlSpec = fph.getURLSpecFromFile(aFile);
+
+    return "moz-icon://" + urlSpec + "?size=16";
+  },
+
+  _getIconURLForWebApp: function(aWebAppURITemplate) {
+    var uri = this._ioSvc.newURI(aWebAppURITemplate, null, null);
+
+    // Unfortunately we can't use the favicon service to get the favicon,
+    // because the service looks in the annotations table for a record with
+    // the exact URL we give it, and users won't have such records for URLs
+    // they don't visit, and users won't visit the web app's URL template,
+    // they'll only visit URLs derived from that template (i.e. with %s
+    // in the template replaced by the URL of the content being handled).
+
+    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";
+      }
+      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 "";
+  }
+
+};
new file mode 100755
--- /dev/null
+++ b/browser/components/preferences/applications.xul
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+
+<!--
+# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Firefox Preferences System.
+#
+# The Initial Developer of the Original Code is
+# Ben Goodger.
+# Portions created by the Initial Developer are Copyright (C) 2005
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Ben Goodger <ben@mozilla.org>
+#   Jeff Walden <jwalden+code@mit.edu>.
+#   Asaf Romano <mozilla.mano@sent.com>
+#   Myk Melez <myk@mozilla.org>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+-->
+
+<!DOCTYPE overlay [
+  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+  <!ENTITY % applicationsDTD SYSTEM "chrome://browser/locale/preferences/applications.dtd">
+  %brandDTD;
+  %applicationsDTD;
+]>
+
+<overlay id="ApplicationsPaneOverlay"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+  <prefpane id="paneApplications" onpaneload="gApplicationsPane.init();"
+            helpTopic="prefs-applications" helpURI="chrome://browser/locale/help/help.rdf">
+
+    <preferences id="feedsPreferences">
+      <preference id="browser.feeds.handler"
+                  name="browser.feeds.handler"
+                  type="string"/>
+      <preference id="browser.feeds.handler.default"
+                  name="browser.feeds.handler.default"
+                  type="string"/>
+      <preference id="browser.feeds.handlers.application"
+                  name="browser.feeds.handlers.application"
+                  type="file"/>
+      <preference id="browser.feeds.handlers.webservice"
+                  name="browser.feeds.handlers.webservice"
+                  type="string"/>
+    </preferences>
+
+    <script type="application/x-javascript" src="chrome://browser/content/preferences/applications.js"/>
+
+    <keyset>
+      <key key="&focusSearch1.key;" modifiers="accel" oncommand="gApplicationsPane.focusFilterBox();"/>
+      <key key="&focusSearch2.key;" modifiers="accel" oncommand="gApplicationsPane.focusFilterBox();"/>
+    </keyset>
+
+    <label>&prefpane.label;</label>
+
+    <vbox flex="1" class="contentPane">
+      <hbox align="center">
+        <label accesskey="&filter.accesskey;" control="filter">&filter.label;</label>
+        <textbox id="filter" flex="1" oninput="gApplicationsPane.onFilterInput();" 
+                onkeypress="gApplicationsPane.onFilterKeyPress(event);"/>
+        <button id="clearFilter" icon="clear" label="&clear.label;" accesskey="&clear.accesskey;" 
+                oncommand="gApplicationsPane.clearFilter();" disabled="true"/>
+      </hbox>
+
+      <separator class="thin"/>
+
+      <label id="filterActiveLabel" hidden="true">
+        &filterActive.label;
+      </label>
+
+      <separator class="thin"/>
+
+      <richlistbox id="handlersView" orient="vertical" style="height: 300px"
+                   onselect="gApplicationsPane.onSelectionChanged();"
+                   persist="lastSelectedType">
+        <listheader equalsize="always" style="border: 0; padding: 0;">
+          <treecol id="typeColumn" label="&typeColumn.label;" value="type"
+                   accesskey="&typeColumn.accesskey;" persist="sortDirection"
+                   flex="1" onclick="gApplicationsPane.sort(event);"
+                   sortDirection="ascending"/>
+          <treecol id="actionColumn" label="&actionColumn.label;" value="action"
+                   accesskey="&actionColumn.accesskey;" persist="sortDirection"
+                   flex="1" onclick="gApplicationsPane.sort(event);"/>
+        </listheader>
+      </richlistbox>
+    </vbox>
+
+  </prefpane>
+</overlay>
deleted file mode 100644
--- a/browser/components/preferences/changeaction.js
+++ /dev/null
@@ -1,255 +0,0 @@
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Download Actions Manager.
-#
-# The Initial Developer of the Original Code is
-# Ben Goodger.
-# Portions created by the Initial Developer are Copyright (C) 2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Ben Goodger <ben@mozilla.org>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-var gChangeActionDialog = {
-  _item             : null,
-  _bundle           : null,
-  _lastSelectedMode : null,
-  _lastSelectedSave : null,
-
-  init: function ()
-  {
-    this._item = window.arguments[0];
-    this._bundle = document.getElementById("bundlePreferences");
-    dump("*** ir = " + this._item.toSource() + "\n");
-    
-    var typeField = document.getElementById("typeField");
-    typeField.value = this._item.typeName;
-    
-    var extensionField = document.getElementById("extensionField");
-    var ext = "." + this._item.extension.toLowerCase();
-    var contentType = this._item.type;
-    extensionField.value = this._bundle.getFormattedString("extensionStringFormat", [ext, contentType]);
-    
-    var typeIcon = document.getElementById("typeIcon");
-    typeIcon.src = this._item.bigIcon;
-
-    // Custom App Handler Path - this must be set before we set the selected
-    // radio button because the selection event handler for the radio group
-    // requires the extapp handler field to be non-empty for the extapp radio
-    // button to be selected. 
-    var customApp = document.getElementById("customApp");
-    if (this._item.customHandler)
-      customApp.file = this._item.customHandler;
-    else
-      customApp.file = null;
-
-    var defaultApp = document.getElementById("defaultApp");
-    var defaultAppIcon = null;
-    var fallbackIconURL = "moz-icon://goat?contentType=" + this._item.type + "&size=16";
-    if (this._item.mimeInfo instanceof Components.interfaces.nsIPropertyBag) {
-      try {
-        defaultAppIcon = this._item.mimeInfo.getProperty("defaultApplicationIconURL");
-      }
-      catch (e) { }
-      if (defaultAppIcon)
-        defaultAppIcon += "?size=16";
-    }
-    defaultApp.image = defaultAppIcon || fallbackIconURL;
-    defaultApp.label = this._item.mimeInfo.defaultDescription;
-
-    var pluginName = document.getElementById("pluginName");
-    var foundPlugin = false;
-    for (var i = 0; i < navigator.plugins.length; ++i) {
-      var plugin = navigator.plugins[i];
-      for (var j = 0; j < plugin.length; ++j) {
-        if (contentType == plugin[j].type) {
-          pluginName.label = plugin.name;
-          pluginName.image = "moz-icon://goat.goat?contentType=" + contentType + "&size=16";
-          foundPlugin = true;
-        }
-      }
-    }
-    if (!foundPlugin) {
-      pluginName.label = this._bundle.getString("pluginHelperNoneAvailable");
-      document.getElementById("plugin").disabled = true;
-    }
-      
-    // Selected Action Radiogroup
-    var handlerGroup = document.getElementById("handlerGroup");
-    if (this._item.handleMode == FILEACTION_OPEN_PLUGIN && this._item.pluginEnabled)
-      handlerGroup.selectedItem = document.getElementById("plugin");
-    else {
-      if (this._item.handleMode == FILEACTION_OPEN_DEFAULT)
-        handlerGroup.selectedItem = document.getElementById("openDefault");
-      else if (this._item.handleMode == FILEACTION_SAVE_TO_DISK)
-        handlerGroup.selectedItem = document.getElementById("saveToDisk");
-      else
-        handlerGroup.selectedItem = document.getElementById("openApplication");
-    }
-    this._lastSelectedMode = handlerGroup.selectedItem;
-    
-    // Figure out the last selected Save As mode
-    var saveToOptions = document.getElementById("saveToOptions");
-    this._lastSelectedSave = saveToOptions.selectedItem;
-
-    // We don't let users open .exe files or random binary data directly 
-    // from the browser at the moment because of security concerns. 
-    var mimeType = this._item.mimeInfo.MIMEType;
-    if (mimeType == "application/object-stream" ||
-        mimeType == "application/x-msdownload") {
-      document.getElementById("openApplication").disabled = true;
-      document.getElementById("openDefault").disabled = true;
-      handlerGroup.selectedItem = document.getElementById("saveToDisk");
-    }
-  },
-  
-  onAccept: function ()
-  {
-    var contentType = this._item.mimeInfo.MIMEType;
-    var handlerGroup = document.getElementById("handlerGroup");
-    switch (handlerGroup.selectedItem.value) {
-    case "plugin":
-      this._item.handleMode = FILEACTION_OPEN_PLUGIN;
-      var pluginName = document.getElementById("pluginName");
-      this._item.action = this._bundle.getFormattedString("openWith", [pluginName.label]);
-      this._item.pluginEnabled = true;
-      break;
-    case "system":
-      this._item.handledOnlyByPlugin = false;
-      this._item.handleMode = FILEACTION_OPEN_DEFAULT;
-      var defaultDescr = this._item.mimeInfo.defaultDescription;
-      this._item.action = this._bundle.getFormattedString("openWith", [defaultDescr]);
-      break;
-    case "app":
-      this._item.handledOnlyByPlugin = false;
-      this._item.handleMode = FILEACTION_OPEN_CUSTOM;
-      var customApp = document.getElementById("customApp");
-      this._item.action = this._bundle.getFormattedString("openWith", [customApp.label]);        
-      break;  
-    case "save":
-      this._item.handledOnlyByPlugin = false;
-      this._item.handleMode = FILEACTION_SAVE_TO_DISK;
-      this._item.action = this._bundle.getString("saveToDisk");
-      break;  
-    }
-    
-    // The opener uses the modifications to the FileAction item to update the
-    // datasource.
-    return true;
-  },
-  
-  doEnabling: function (aSelectedItem)
-  {
-    var defaultApp            = document.getElementById("defaultApp");
-    var saveToDefault         = document.getElementById("saveToDefault");
-    var saveToCustom          = document.getElementById("saveToCustom");
-    var customDownloadFolder  = document.getElementById("customDownloadFolder");
-    var chooseCustomDownloadFolder = document.getElementById("chooseCustomDownloadFolder");
-    var saveToAskMe           = document.getElementById("saveToAskMe");
-    var pluginName            = document.getElementById("pluginName");
-    var changeApp             = document.getElementById("changeApp");
-    var customApp             = document.getElementById("customApp");
-    
-    switch (aSelectedItem.id) {
-    case "openDefault":
-      changeApp.disabled = customApp.disabled = saveToDefault.disabled = saveToCustom.disabled = customDownloadFolder.disabled = chooseCustomDownloadFolder.disabled = saveToAskMe.disabled = pluginName.disabled = true;
-      defaultApp.disabled = false;
-      break;
-    case "openApplication":
-      defaultApp.disabled = saveToDefault.disabled = saveToCustom.disabled = customDownloadFolder.disabled = chooseCustomDownloadFolder.disabled = saveToAskMe.disabled = pluginName.disabled = true;
-      changeApp.disabled = customApp.disabled = false;
-      if (!customApp.file && !this.changeApp()) {
-        this._lastSelectedMode.click();
-        return;
-      }
-      break;
-    case "saveToDisk":
-      changeApp.disabled = customApp.disabled = defaultApp.disabled = pluginName.disabled = true;
-      var saveToOptions = document.getElementById("saveToOptions");
-      customDownloadFolder.disabled = chooseCustomDownloadFolder.disabled = !(saveToOptions.selectedItem.id == "saveToCustom");
-      saveToDefault.disabled = saveToCustom.disabled = saveToAskMe.disabled = false;
-      break;
-    case "plugin":
-      changeApp.disabled = customApp.disabled = defaultApp.disabled = saveToDefault.disabled = saveToCustom.disabled = customDownloadFolder.disabled = chooseCustomDownloadFolder.disabled = saveToAskMe.disabled = true;
-      pluginName.disabled = false;
-      break;
-    }
-    this._lastSelectedMode = aSelectedItem;
-  },
-  
-  doSaveToDiskEnabling: function (aSelectedItem)
-  {
-    var isSaveToCustom = aSelectedItem.id == "saveToCustom";
-    var customDownloadFolder = document.getElementById("customDownloadFolder");
-    var chooseCustomDownloadFolder = document.getElementById("chooseCustomDownloadFolder");
-    chooseCustomDownloadFolder.disabled = customDownloadFolder.disabled = !isSaveToCustom;
-    
-    if (isSaveToCustom && 
-        !customDownloadFolder.file && !this.changeCustomFolder()) {
-      this._lastSelectedSave.click();
-      return;
-    }
-    this._lastSelectedSave = aSelectedItem;
-  },
-  
-  changeApp: function ()
-  {
-    const nsIFilePicker = Components.interfaces.nsIFilePicker;
-    var fp = Components.classes["@mozilla.org/filepicker;1"]
-                       .createInstance(nsIFilePicker);
-    var winTitle = this._bundle.getString("fpTitleChooseApp");
-    fp.init(window, winTitle, nsIFilePicker.modeOpen);
-    fp.appendFilters(nsIFilePicker.filterApps);
-    if (fp.show() == nsIFilePicker.returnOK && fp.file) {
-      var customApp = document.getElementById("customApp");
-      customApp.file = fp.file;
-      this._item.customHandler = fp.file;      
-      return true;
-    }
-    return false;
-  },
-  
-  changeCustomFolder: function ()
-  {
-    const nsIFilePicker = Components.interfaces.nsIFilePicker;
-    var fp = Components.classes["@mozilla.org/filepicker;1"]
-                       .createInstance(nsIFilePicker);
-
-    // extract the window title
-    var winTitle = this._bundle.getString("fpTitleChooseDL");
-    fp.init(window, winTitle, nsIFilePicker.modeGetFolder);
-    if (fp.show() == nsIFilePicker.returnOK && fp.file) {
-      var customDownloadFolder = document.getElementById("customDownloadFolder");
-      customDownloadFolder.file = fp.file;
-      customDownloadFolder.label = fp.file.path;
-      return true;
-    }
-    return false;
-  }
-};
deleted file mode 100644
--- a/browser/components/preferences/changeaction.xul
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0"?>
-
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Download Actions Manager.
-#
-# The Initial Developer of the Original Code is
-# Ben Goodger.
-# Portions created by the Initial Developer are Copyright (C) 2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Ben Goodger <ben@mozilla.org>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-<?xml-stylesheet href="chrome://global/skin/"?>
-<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css" type="text/css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://browser/locale/preferences/changeaction.dtd">
-
-<dialog id="ChangeActionDialog" title="&changeAction.title;"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="gChangeActionDialog.init();"
-        buttons="accept,cancel,help"
-        ondialogaccept="return gChangeActionDialog.onAccept();" 
-        ondialoghelp="openHelp('prefs-file-types', 'chrome://browser/locale/help/help.rdf');"
-        xmlns:aaa="http://www.w3.org/2005/07/aaa"
-        style="width: &window.width;;"
-        persist="screenX screenY">
-
-  <script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/>
-  <script type="application/x-javascript" src="chrome://browser/content/preferences/changeaction.js"/>
-  <script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
-  
-  <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
-
-  <hbox id="changeActionHeader" align="center" class="indent">
-    <image id="typeIcon"/>
-    <vbox flex="1">
-      <label id="typeField" crop="right"/>
-      <label id="extensionField" crop="right"/>
-    </vbox>
-  </hbox>
-  <vbox id="changeActionContent" flex="1">
-    <label control="handlerGroup">&whenDownloading.label;</label>
-    <radiogroup id="handlerGroup" onselect="gChangeActionDialog.doEnabling(this.selectedItem);" 
-                flex="1" aaa:describedby="changeActionHeader">
-      <separator class="thin"/>
-      <radio id="openDefault" value="system" 
-             label="&openDefault.label;" accesskey="&openDefault.accesskey;"
-             aaa:labelledby="openDefault defaultApp"/>
-      <filefield class="indent" id="defaultApp" disabled="true"/>
-      <separator class="thin"/>
-      <radio id="openApplication" value="app" 
-             label="&openApplication.label;" accesskey="&openApplication.accesskey;"
-             aaa:labelledby="openApplication customApp"/>
-      <hbox align="center">
-        <filefield id="customApp" class="indent" flex="1" disabled="true"/>
-        <button id="changeApp" oncommand="gChangeActionDialog.changeApp();" 
-                label="&changeApp.label;" accesskey="&changeApp.accesskey;"
-                disabled="true"/>
-      </hbox>
-      <separator class="thin"/>
-      <radio id="saveToDisk" value="save" 
-             label="&saveToDisk.label;" accesskey="&saveToDisk.accesskey;"/>
-      <radiogroup id="saveToOptions" class="indent" onselect="gChangeActionDialog.doSaveToDiskEnabling(this.selectedItem);"
-                  hidden="true">
-        <radio id="saveToDefault" value="default" selected="true"
-               label="&saveToDefaultFolder.label;" accesskey="&saveToDefaultFolder.accesskey;"/>
-        <radio id="saveToCustom" value="custom"
-               label="&saveToThisFolder.label;" accesskey="&saveToThisFolder.accesskey;"
-               aaa:labelledby="saveToCustom customDownloadFolder"/>
-        <hbox align="center" class="indent">
-          <filefield id="customDownloadFolder" flex="1"/>
-          <button id="chooseCustomDownloadFolder" oncommand="gChangeActionDialog.changeCustomFolder();"
-                  label="&chooseFolder.label;" accesskey="&chooseFolder.accesskey;"/>
-        </hbox>
-        <radio id="saveToAskMe" value="ask"
-               label="&saveToAskMe.label;" accesskey="&saveToAskMe.accesskey;"/>
-      </radiogroup>
-      <radio id="plugin" value="plugin" 
-             label="&usePlugin.label;" accesskey="&usePlugin.accesskey;"
-             aaa:labelledby="plugin pluginName"/>
-      <filefield class="indent" id="pluginName" disabled="true"/>
-    </radiogroup>
-  </vbox>
-</dialog>
-
--- a/browser/components/preferences/content.js
+++ b/browser/components/preferences/content.js
@@ -53,17 +53,17 @@ var gContentPane = {
     }
   },
 
   // UTILITY FUNCTIONS
 
   /**
    * Utility function to enable/disable the button specified by aButtonID based
    * on the value of the Boolean preference specified by aPreferenceID.
-   */  
+   */
   updateButtons: function (aButtonID, aPreferenceID)
   {
     var button = document.getElementById(aButtonID);
     var preference = document.getElementById(aPreferenceID);
     button.disabled = preference.value != true;
     return undefined;
   },
 
@@ -257,23 +257,11 @@ var gContentPane = {
   /**
    * Displays the colors dialog, where default web page/link/etc. colors can be
    * configured.
    */
   configureColors: function ()
   {
     document.documentElement.openSubDialog("chrome://browser/content/preferences/colors.xul",
                                            "", null);  
-  },
-
-  // FILE TYPES
-
-  /**
-   * Displays the file type configuration dialog.
-   */
-  configureFileTypes: function ()
-  {
-    document.documentElement.openWindow("Preferences:DownloadActions",
-                                        "chrome://browser/content/preferences/downloadactions.xul",
-                                        "", null);
   }
 
 };
--- a/browser/components/preferences/content.xul
+++ b/browser/components/preferences/content.xul
@@ -68,21 +68,16 @@
                   name="pref.advanced.javascript.disable_button.advanced"
                   type="bool"/>
 
       <!-- FONTS -->
       <preference id="font.language.group"
                   name="font.language.group"
                   type="wstring"
                   onchange="gContentPane._rebuildFonts();"/>
-
-      <!-- FILE TYPES -->
-      <preference id="pref.downloads.disable_button.edit_actions"
-                  name="pref.downloads.disable_button.edit_actions"
-                  type="bool"/>
     </preferences>
     
     <script type="application/x-javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
     <script type="application/x-javascript" src="chrome://browser/content/preferences/content.js"/>
 
     <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
 
     <!-- various checkboxes, font-fu -->
@@ -202,25 +197,11 @@
                     label="&colors.label;"
                     accesskey="&colors.accesskey;"
                     oncommand="gContentPane.configureColors();"/>
           </row>
         </rows>
       </grid>
     </groupbox>
 
-    <!-- File Types -->
-    <groupbox id="fileTypesGroup">
-      <caption label="&fileTypes.label;"/>
-
-      <hbox id="configureFileTypesRow" align="center">
-        <description control="manageTypes" flex="1">&configureFileTypes.label;</description>
-        <button id="manageTypes"
-                label="&manage.label;"
-                accesskey="&manage.accesskey;"
-                oncommand="gContentPane.configureFileTypes();"
-                preference="pref.downloads.disable_button.edit_actions"/>
-      </hbox>
-    </groupbox>
-
   </prefpane>
 
 </overlay>
deleted file mode 100644
--- a/browser/components/preferences/downloadactions.js
+++ /dev/null
@@ -1,870 +0,0 @@
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Download Actions Manager.
-#
-# The Initial Developer of the Original Code is
-# Ben Goodger.
-# Portions created by the Initial Developer are Copyright (C) 2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Ben Goodger <ben@mozilla.org>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-const kPluginHandlerContractID = "@mozilla.org/content/plugin/document-loader-factory;1";
-const kDisabledPluginTypesPref = "plugin.disable_full_page_plugin_for_types";
-const kShowPluginsInList = "browser.download.show_plugins_in_list";
-const kHideTypesWithoutExtensions = "browser.download.hide_plugins_without_extensions";
-const kRootTypePrefix = "urn:mimetype:";
-
-///////////////////////////////////////////////////////////////////////////////
-// MIME Types Datasource RDF Utils
-function NC_URI(aProperty)
-{
-  return "http://home.netscape.com/NC-rdf#" + aProperty;
-}
-
-function MIME_URI(aType)
-{
-  return "urn:mimetype:" + aType;
-}
-
-function HANDLER_URI(aHandler)
-{
-  return "urn:mimetype:handler:" + aHandler;
-}
-
-function APP_URI(aType)
-{
-  return "urn:mimetype:externalApplication:" + aType;
-}
-
-var gDownloadActionsWindow = {  
-  _tree         : null,
-  _editButton   : null,
-  _removeButton : null,
-  _actions      : [],
-  _plugins      : {},
-  _bundle       : null,
-  _pref         : Components.classes["@mozilla.org/preferences-service;1"]
-                            .getService(Components.interfaces.nsIPrefBranch),
-  _mimeSvc      : Components.classes["@mozilla.org/uriloader/external-helper-app-service;1"]
-                            .getService(Components.interfaces.nsIMIMEService),
-  _excludingPlugins           : false,
-  _excludingMissingExtensions : false,
-  
-  init: function ()
-  {
-    (this._editButton = document.getElementById("editFileHandler")).disabled = true;
-    (this._removeButton = document.getElementById("removeFileHandler")).disabled = true;    
-
-    if (this._pref instanceof Components.interfaces.nsIPrefBranchInternal) {
-      this._pref.addObserver(kShowPluginsInList, this, false);
-      this._pref.addObserver(kHideTypesWithoutExtensions, this, false);
-    }
-    
-    // Initialize the File Type list
-    this._bundle = document.getElementById("bundlePreferences");
-    this._tree = document.getElementById("fileHandlersList");
-    this._loadView();
-    // Determine any exclusions being applied - e.g. don't show types for which
-    // only a plugin handler exists, don't show types lacking extensions, etc. 
-    this._view._rowCount = this._updateExclusions();    
-    this._tree.treeBoxObject.view = this._view;  
-
-    var indexToSelect = parseInt(this._tree.getAttribute("lastSelected"));
-    if (indexToSelect < this._tree.view.rowCount)
-      this._tree.view.selection.select(indexToSelect);
-    this._tree.focus();    
-  },
-  
-  _loadView: function ()
-  {
-    // Reset ALL the collections and state flags, because we can call this after
-    // the window has initially displayed by resetting the filter. 
-    this._actions = [];
-    this._plugins = {};
-    this._view._filtered = false;
-    this._view._filterSet = [];
-    this._view._usingExclusionSet = false;
-    this._view._exclusionSet = [];
-    this._view._filterValue = "";
-
-    this._loadPluginData();
-    this._loadMIMERegistryData();
-  },
-  
-  _updateRowCount: function (aNewRowCount)
-  {
-    var oldCount = this._view._rowCount;
-    this._view._rowCount = 0;
-    this._tree.treeBoxObject.rowCountChanged(0, -oldCount);
-    this._view._rowCount = aNewRowCount;
-    this._tree.treeBoxObject.rowCountChanged(0, aNewRowCount);
-  },
-  
-  uninit: function ()
-  {
-    if (this._pref instanceof Components.interfaces.nsIPrefBranchInternal) {
-      this._pref.removeObserver(kShowPluginsInList, this);
-      this._pref.removeObserver(kHideTypesWithoutExtensions, this);
-    }
-  },
-  
-  observe: function (aSubject, aTopic, aData)
-  {
-    if (aTopic == "nsPref:changed" &&
-        (aData == kShowPluginsInList || aData == kHideTypesWithoutExtensions))
-      this._updateRowCount(this._updateExclusions());
-  },
-  
-  _updateExclusions: function ()
-  {
-    this._excludingPlugins = !this._pref.getBoolPref(kShowPluginsInList);
-    this._excludingMissingExtensions = this._pref.getBoolPref(kHideTypesWithoutExtensions);    
-    this._view._exclusionSet = [].concat(this._actions);
-    if (this._excludingMissingExtensions) {
-      this._view._usingExclusionSet = true;
-      for (var i = 0; i < this._view._exclusionSet.length;) {
-        if (!this._view._exclusionSet[i].hasExtension)
-          this._view._exclusionSet.splice(i, 1);
-        else
-          ++i;
-      }
-    }
-    if (this._excludingPlugins) {
-      this._view._usingExclusionSet = true;
-      for (i = 0; i < this._view._exclusionSet.length;) {
-        if (this._view._exclusionSet[i].handledOnlyByPlugin)
-          this._view._exclusionSet.splice(i, 1);
-        else
-          ++i        
-      }      
-    }
-
-    return this._view._usingExclusionSet ? this._view._exclusionSet.length 
-                                         : this._view._filtered ? this._view._filterSet.length 
-                                                                : this._actions.length;
-  },
-  
-  _loadPluginData: function ()
-  {
-    // Read enabled plugin type information from the category manager
-    var disabled = "";
-    if (this._pref.prefHasUserValue(kDisabledPluginTypesPref)) 
-      disabled = this._pref.getCharPref(kDisabledPluginTypesPref);
-    
-    for (var i = 0; i < navigator.plugins.length; ++i) {
-      var plugin = navigator.plugins[i];
-      for (var j = 0; j < plugin.length; ++j) {
-        var actionName = this._bundle.getFormattedString("openWith", [plugin.name])
-        var type = plugin[j].type;
-        this._createAction(type, actionName, true, FILEACTION_OPEN_PLUGIN, 
-                           null, true, disabled.indexOf(type) == -1, true);
-      }
-    }
-  },
-
-  _createAction: function (aMIMEType, aActionName, 
-                           aIsEditable, aHandleMode, aCustomHandler,
-                           aPluginAvailable, aPluginEnabled, 
-                           aHandledOnlyByPlugin)
-  {
-    var newAction = !(aMIMEType in this._plugins);
-    var action = newAction ? new FileAction() : this._plugins[aMIMEType];
-    action.type = aMIMEType;
-    var info = this._mimeSvc.getFromTypeAndExtension(action.type, null);
-    
-    // File Extension
-    try {
-      action.extension = info.primaryExtension;
-    }
-    catch (e) {
-      action.extension = this._bundle.getString("extensionNone");
-      action.hasExtension = false;
-    }
-    
-    // Large and Small Icon
-    try {
-      action.smallIcon = "moz-icon://goat." + info.primaryExtension + "?size=16";
-      action.bigIcon = "moz-icon://goat." + info.primaryExtension + "?size=32";
-    }
-    catch (e) {
-      action.smallIcon = "moz-icon://goat?size=16&contentType=" + info.MIMEType;
-      action.bigIcon = "moz-icon://goat?contentType=" + info.MIMEType + "&size=32";
-    }
-
-    // Pretty Type Name
-    if (info.description == "") {
-      try {
-        action.typeName = this._bundle.getFormattedString("fileEnding", [info.primaryExtension.toUpperCase()]);
-      }
-      catch (e) { 
-        // Wow, this sucks, just show the MIME type as a last ditch effort to display
-        // the type of file that this is. 
-        action.typeName = info.MIMEType;
-      }
-    }
-    else
-      action.typeName = info.description;
-
-    // Pretty Action Name
-    if (aActionName)
-      action.action         = aActionName;
-    action.pluginAvailable  = aPluginAvailable;
-    action.pluginEnabled    = aPluginEnabled;
-    action.editable         = aIsEditable;
-    action.handleMode       = aHandleMode;
-    action.customHandler    = aCustomHandler;
-    action.mimeInfo         = info;
-    action.handledOnlyByPlugin  = aHandledOnlyByPlugin
-    
-    if (newAction && !(action.handledOnlyByPlugin && !action.pluginEnabled)) {
-      this._actions.push(action);
-      this._plugins[action.type] = action;
-    }      
-    return action;
-  },
-  
-  _loadMIMEDS: function ()
-  {
-    var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
-                                .getService(Components.interfaces.nsIProperties);
-    
-    var file = fileLocator.get("UMimTyp", Components.interfaces.nsIFile);
-
-    var ioService = Components.classes["@mozilla.org/network/io-service;1"]
-                              .getService(Components.interfaces.nsIIOService);
-    var fileHandler = ioService.getProtocolHandler("file")
-                               .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
-    this._mimeDS = this._rdf.GetDataSourceBlocking(fileHandler.getURLSpecFromFile(file));
-  },
-  
-  _getLiteralValue: function (aResource, aProperty)
-  {
-    var property = this._rdf.GetResource(NC_URI(aProperty));
-    var value = this._mimeDS.GetTarget(aResource, property, true);
-    if (value)
-      return value.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
-    return "";
-  },
-  
-  _getChildResource: function (aResource, aProperty)
-  {
-    var property = this._rdf.GetResource(NC_URI(aProperty));
-    return this._mimeDS.GetTarget(aResource, property, true);
-  },
-  
-  _getDisplayNameForFile: function (aFile)
-  {
-#ifdef XP_WIN
-    if (aFile instanceof Components.interfaces.nsILocalFileWin) {
-      try {
-        return aFile.getVersionInfoField("FileDescription"); 
-      }
-      catch (e) {
-        // fall through to the filename
-      }
-    }
-#endif
-#ifdef XP_MACOSX
-    var lfm = aFile.QueryInterface(Components.interfaces.nsILocalFileMac);
-    try {
-      return lfm.bundleDisplayName;
-    }
-    catch (e) {
-      // fall through to the file name
-    }
-#endif
-    var ios = Components.classes["@mozilla.org/network/io-service;1"]
-                        .getService(Components.interfaces.nsIIOService);
-    var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL);
-    return url.fileName;
-  },  
-  
-  _loadMIMERegistryData: function ()
-  {
-    this._rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"]
-                          .getService(Components.interfaces.nsIRDFService);
-    this._loadMIMEDS();                          
-                          
-    var root = this._rdf.GetResource("urn:mimetypes:root");
-    var container = Components.classes["@mozilla.org/rdf/container;1"]
-                              .createInstance(Components.interfaces.nsIRDFContainer);
-    container.Init(this._mimeDS, root);
-    
-    var elements = container.GetElements();
-    while (elements.hasMoreElements()) {
-      var type = elements.getNext();
-      if (!(type instanceof Components.interfaces.nsIRDFResource))
-        break;
-      var editable = this._getLiteralValue(type, "editable") == "true";
-      if (!editable)
-        continue;
-      
-      var handler = this._getChildResource(type, "handlerProp");
-      var alwaysAsk = this._getLiteralValue(handler, "alwaysAsk") == "true";
-      if (alwaysAsk)
-        continue;
-      var saveToDisk        = this._getLiteralValue(handler, "saveToDisk") == "true";
-      var useSystemDefault  = this._getLiteralValue(handler, "useSystemDefault") == "true";
-      var editable          = this._getLiteralValue(type, "editable") == "true";
-      var handledInternally = this._getLiteralValue(handler, "handleInternal") == "true";
-      var externalApp       = this._getChildResource(handler, "externalApplication");
-      var externalAppPath   = this._getLiteralValue(externalApp, "path");
-      try {
-        var customHandler = Components.classes["@mozilla.org/file/local;1"]
-                                      .createInstance(Components.interfaces.nsILocalFile);
-        customHandler.initWithPath(externalAppPath);
-      }
-      catch (e) {
-        customHandler = null;
-      }      
-      if (customHandler && !customHandler.exists())
-        customHandler = null;
-      var mimeType = this._getLiteralValue(type, "value");
-      var typeInfo = this._mimeSvc.getFromTypeAndExtension(mimeType, null);
-
-      // Determine the pretty name of the associated action.
-      var actionName = "";
-      var handleMode = 0;
-      if (saveToDisk) {
-        // Save the file to disk
-        actionName = this._bundle.getString("saveToDisk");
-        handleMode = FILEACTION_SAVE_TO_DISK;
-      }
-      else if (useSystemDefault) {
-        // Use the System Default handler
-        actionName = this._bundle.getFormattedString("openWith", 
-                                                     [typeInfo.defaultDescription]);
-        handleMode = FILEACTION_OPEN_DEFAULT;
-      }
-      else {
-        // Custom Handler
-        if (customHandler) {
-          actionName = this._bundle.getFormattedString("openWith", 
-                                                       [this._getDisplayNameForFile(customHandler)]);
-          handleMode = FILEACTION_OPEN_CUSTOM;
-        }
-        else {
-          // Corrupt datasource, invalid custom handler path. Revert to default.
-          actionName = this._bundle.getFormattedString("openWith", 
-                                                       [typeInfo.defaultDescription]);
-          handleMode = FILEACTION_OPEN_DEFAULT;
-        }
-      }
-
-      if (handledInternally)
-        handleMode = FILEACTION_OPEN_INTERNALLY;
-      
-      var pluginAvailable = mimeType in this._plugins && this._plugins[mimeType].pluginAvailable;
-      var pluginEnabled = pluginAvailable && this._plugins[mimeType].pluginEnabled;
-      if (pluginEnabled) {
-        handleMode = FILEACTION_OPEN_PLUGIN;
-        actionName = null;
-      }
-      var action = this._createAction(mimeType, actionName, editable, handleMode, 
-                                      customHandler, pluginAvailable, pluginEnabled,
-                                      false);
-    }
-  },
-  
-  _view: {
-    _filtered           : false,
-    _filterSet          : [],
-    _usingExclusionSet  : false,
-    _exclusionSet       : [],
-    _filterValue        : "",
-
-    _rowCount: 0,
-    get rowCount() 
-    { 
-      return this._rowCount; 
-    },
-    
-    get activeCollection ()
-    {
-      return this._filtered ? this._filterSet 
-                            : this._usingExclusionSet ? this._exclusionSet 
-                                                      : gDownloadActionsWindow._actions;
-    },
-
-    getItemAtIndex: function (aIndex)
-    {
-      return this.activeCollection[aIndex];
-    },
-    
-    getCellText: function (aIndex, aColumn)
-    {
-      switch (aColumn.id) {
-      case "fileExtension":
-        return this.getItemAtIndex(aIndex).extension.toUpperCase();
-      case "fileType":
-        return this.getItemAtIndex(aIndex).typeName;
-      case "fileMIMEType":
-        return this.getItemAtIndex(aIndex).type;
-      case "fileHandler":
-        return this.getItemAtIndex(aIndex).action;
-      }
-      return "";
-    },
-    getImageSrc: function (aIndex, aColumn) 
-    {
-      if (aColumn.id == "fileExtension") 
-        return this.getItemAtIndex(aIndex).smallIcon;
-      return "";
-    },
-    _selection: null, 
-    get selection () { return this._selection; },
-    set selection (val) { this._selection = val; return val; },
-    getRowProperties: function (aIndex, aProperties) {},
-    getCellProperties: function (aIndex, aColumn, aProperties) {},
-    getColumnProperties: function (aColumn, aProperties) {},
-    isContainer: function (aIndex) { return false; },
-    isContainerOpen: function (aIndex) { return false; },
-    isContainerEmpty: function (aIndex) { return false; },
-    isSeparator: function (aIndex) { return false; },
-    isSorted: function (aIndex) { return false; },
-    canDrop: function (aIndex, aOrientation) { return false; },
-    drop: function (aIndex, aOrientation) {},
-    getParentIndex: function (aIndex) { return -1; },
-    hasNextSibling: function (aParentIndex, aIndex) { return false; },
-    getLevel: function (aIndex) { return 0; },
-    getProgressMode: function (aIndex, aColumn) {},    
-    getCellValue: function (aIndex, aColumn) {},
-    setTree: function (aTree) {},    
-    toggleOpenState: function (aIndex) { },
-    cycleHeader: function (aColumn) {},    
-    selectionChanged: function () {},    
-    cycleCell: function (aIndex, aColumn) {},    
-    isEditable: function (aIndex, aColumn) { return false; },
-    isSelectable: function (aIndex, aColumn) { return false; },
-    setCellValue: function (aIndex, aColumn, aValue) {},    
-    setCellText: function (aIndex, aColumn, aValue) {},    
-    performAction: function (aAction) {},  
-    performActionOnRow: function (aAction, aIndex) {},    
-    performActionOnCell: function (aAction, aindex, aColumn) {}
-  },
-
-  removeFileHandler: function ()
-  {
-    var selection = this._tree.view.selection; 
-    if (selection.count < 1)
-      return;
-      
-    var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
-                                  .getService(Components.interfaces.nsIPromptService);
-    var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0;
-    flags += promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1;
-
-    var title = this._bundle.getString("removeTitle" + (selection.count > 1 ? "Multiple" : "Single"));
-    var message = this._bundle.getString("removeMessage" + (selection.count > 1 ? "Multiple" : "Single"));
-    var button = this._bundle.getString("removeButton" + (selection.count > 1 ? "Multiple" : "Single"));
-    var rv = promptService.confirmEx(window, title, message, flags, button, 
-                                     null, null, null, { value: 0 });
-    if (rv != 0)
-      return;     
-
-    var rangeCount = selection.getRangeCount();
-    var lastSelected = 0;
-    var mimeDSDirty = false;
-    for (var i = 0; i < rangeCount; ++i) {
-      var min = { }; var max = { };
-      selection.getRangeAt(i, min, max);
-      for (var j = min.value; j <= max.value; ++j) {
-        var item = this._view.getItemAtIndex(j);
-        if (!item.handledOnlyByPlugin) {
-          // There is data for this type in the MIME registry, so make sure we
-          // remove it from the MIME registry. We don't disable the plugin here because
-          // if we do there's currently no way through the UI to re-enable it. We may
-          // come up with some sort of solution for that at a later date. 
-          var typeRes = this._rdf.GetResource(MIME_URI(item.type));
-          var handlerRes = this._getChildResource(typeRes, "handlerProp");
-          var extAppRes = this._getChildResource(handlerRes, "externalApplication");
-          this._cleanResource(extAppRes);
-          this._cleanResource(handlerRes);
-          this._cleanResource(typeRes); 
-          mimeDSDirty = true;         
-        }
-        lastSelected = (j + 1) >= this._view.rowCount ? j-1 : j;
-      }
-    }
-    if (mimeDSDirty && 
-        this._mimeDS instanceof Components.interfaces.nsIRDFRemoteDataSource)
-      this._mimeDS.Flush();
-    
-    // Just reload the list to make sure deletions are respected
-    this._loadView();
-    this._updateRowCount(this._updateExclusions());
-
-    selection.select(lastSelected);
-  },
-  
-  _cleanResource: function (aResource)
-  {
-    var labels = this._mimeDS.ArcLabelsOut(aResource);
-    while (labels.hasMoreElements()) {
-      var arc = labels.getNext();
-      if (!(arc instanceof Components.interfaces.nsIRDFResource))
-        break;
-      var target = this._mimeDS.GetTarget(aResource, arc, true);
-      this._mimeDS.Unassert(aResource, arc, target);
-    }
-  },
-  
-  _disablePluginForItem: function (aItem)
-  {
-    if (aItem.pluginAvailable) {
-      // Since we're disabling the full page plugin for this content type, 
-      // we must add it to the disabled list if it's not in there already.
-      var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                            .getService(Components.interfaces.nsIPrefBranch);
-      var disabled = aItem.type;
-      if (prefs.prefHasUserValue(kDisabledPluginTypesPref)) {
-        disabled = prefs.getCharPref(kDisabledPluginTypesPref);
-        if (disabled.indexOf(aItem.type) == -1) 
-          disabled += "," + aItem.type;
-      }
-      prefs.setCharPref(kDisabledPluginTypesPref, disabled);   
-      
-      // Also, we update the category manager so that existing browser windows
-      // update.
-      var catman = Components.classes["@mozilla.org/categorymanager;1"]
-                             .getService(Components.interfaces.nsICategoryManager);
-      catman.deleteCategoryEntry("Gecko-Content-Viewers", aItem.type, false);     
-    }    
-  },
-  
-  _enablePluginForItem: function (aItem)
-  {
-    var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                          .getService(Components.interfaces.nsIPrefBranch);
-    // Since we're enabling the full page plugin for this content type, we must
-    // look at the disabled types list and ensure that this type isn't in it.
-    if (prefs.prefHasUserValue(kDisabledPluginTypesPref)) {
-      var disabledList = prefs.getCharPref(kDisabledPluginTypesPref);
-      if (disabledList == aItem.type)
-        prefs.clearUserPref(kDisabledPluginTypesPref);
-      else {
-        var disabledTypes = disabledList.split(",");
-        var disabled = "";
-        for (var i = 0; i < disabledTypes.length; ++i) {
-          if (aItem.type != disabledTypes[i])
-            disabled += disabledTypes[i] + (i == disabledTypes.length - 1 ? "" : ",");
-        }
-        prefs.setCharPref(kDisabledPluginTypesPref, disabled);
-      }
-    }
-
-    // Also, we update the category manager so that existing browser windows
-    // update.
-    var catman = Components.classes["@mozilla.org/categorymanager;1"]
-                           .getService(Components.interfaces.nsICategoryManager);
-    catman.addCategoryEntry("Gecko-Content-Viewers", aItem.type,
-                            kPluginHandlerContractID, false, true);
-  },
-  
-  _ensureMIMERegistryEntry: function (aItem)
-  {
-    var root = this._rdf.GetResource("urn:mimetypes:root");
-    var container = Components.classes["@mozilla.org/rdf/container;1"]
-                              .createInstance(Components.interfaces.nsIRDFContainer);
-    container.Init(this._mimeDS, root);
-    
-    var itemResource = this._rdf.GetResource(MIME_URI(aItem.type));
-    var handlerResource = null;
-    if (container.IndexOf(itemResource) == -1) {
-      container.AppendElement(itemResource);
-      this._setLiteralValue(itemResource, "editable", "true");
-      this._setLiteralValue(itemResource, "value", aItem.type);
-      
-      handlerResource = this._rdf.GetResource(HANDLER_URI(aItem.type));
-      this._setLiteralValue(handlerResource, "alwaysAsk", "false");
-      var handlerProp = this._rdf.GetResource(NC_URI("handlerProp"));
-      this._mimeDS.Assert(itemResource, handlerProp, handlerResource, true);
-      
-      var extAppResource = this._rdf.GetResource(APP_URI(aItem.type));
-      this._setLiteralValue(extAppResource, "path", "");
-      var extAppProp = this._rdf.GetResource(NC_URI("externalApplication"));
-      this._mimeDS.Assert(handlerResource, extAppProp, extAppResource, true);
-    }
-    else
-      handlerResource = this._getChildResource(itemResource, "handlerProp");
-        
-    return handlerResource;
-  },
-  
-  _setLiteralValue: function (aResource, aProperty, aValue)
-  {
-    var property = this._rdf.GetResource(NC_URI(aProperty));
-    var newValue = this._rdf.GetLiteral(aValue);
-    var oldValue = this._mimeDS.GetTarget(aResource, property, true);
-    if (oldValue)
-      this._mimeDS.Change(aResource, property, oldValue, newValue);
-    else
-      this._mimeDS.Assert(aResource, property, newValue, true);
-  },
-  
-  editFileHandler: function ()
-  {
-    var selection = this._tree.view.selection; 
-    if (selection.count != 1)
-      return;
-
-    var item = this._view.getItemAtIndex(selection.currentIndex);
-    openDialog("chrome://browser/content/preferences/changeaction.xul", 
-               "_blank", "modal,centerscreen", item);
-    
-    // Update the database
-    switch (item.handleMode) {
-    case FILEACTION_OPEN_PLUGIN:
-      this._enablePluginForItem(item);
-      // We don't need to adjust the database because plugin settings always
-      // supercede whatever is in the db, leaving it untouched allows the last
-      // user setting(s) to be preserved if they ever revert.
-      break;
-    case FILEACTION_OPEN_DEFAULT:
-      this._disablePluginForItem(item);
-      var handlerRes = this._ensureMIMERegistryEntry(item);
-      this._setLiteralValue(handlerRes, "useSystemDefault", "true");
-      this._setLiteralValue(handlerRes, "saveToDisk", "false");
-      break;
-    case FILEACTION_OPEN_CUSTOM:
-      this._disablePluginForItem(item);
-      var handlerRes = this._ensureMIMERegistryEntry(item);
-      this._setLiteralValue(handlerRes, "useSystemDefault", "false");
-      this._setLiteralValue(handlerRes, "saveToDisk", "false");
-      var extAppRes = this._getChildResource(handlerRes, "externalApplication");
-      this._setLiteralValue(extAppRes, "path", item.customHandler.path);
-      break;
-    case FILEACTION_SAVE_TO_DISK:
-      this._disablePluginForItem(item);
-      var handlerRes = this._ensureMIMERegistryEntry(item);
-      this._setLiteralValue(handlerRes, "useSystemDefault", "false");
-      this._setLiteralValue(handlerRes, "saveToDisk", "true");
-      break;
-    }
-    
-    if (this._mimeDS instanceof Components.interfaces.nsIRDFRemoteDataSource)
-      this._mimeDS.Flush();
-    
-    // Update the view
-    this._tree.treeBoxObject.invalidateRow(selection.currentIndex);    
-  },
-  
-  onSelectionChanged: function ()
-  {
-    if (this._tree.view.rowCount == 0) {
-      this._removeButton.disabled = true;
-      this._editButton.disabled = true;
-      return;
-    }
-      
-    var selection = this._tree.view.selection; 
-    var selected = selection.count;
-    this._removeButton.disabled = selected == 0;
-    this._editButton.disabled = selected != 1;
-    var stringKey = selected > 1 ? "removeButtonMultiple" : "removeButtonSingle";
-    this._removeButton.label = this._bundle.getString(stringKey);
-    
-    var canRemove = true;
-    var canEdit = true;
-    
-    var rangeCount = selection.getRangeCount();
-    var min = { }, max = { };
-    var setLastSelected = false;
-    for (var i = 0; i < rangeCount; ++i) {
-      selection.getRangeAt(i, min, max);
-      
-      for (var j = min.value; j <= max.value; ++j) {
-        if (!setLastSelected) {
-          // Set the last selected index to the first item in the selection
-          this._tree.setAttribute("lastSelected", j);
-          setLastSelected = true;
-        }
-
-        var item = this._view.getItemAtIndex(j);
-        if (item && 
-            (!item.editable || item.handleMode == FILEACTION_OPEN_INTERNALLY))
-          canEdit = false;
-        
-        if (item && 
-            (!item.editable || item.handleMode == FILEACTION_OPEN_INTERNALLY ||
-             item.handledOnlyByPlugin))
-          canRemove = false;
-      }
-    }
-    
-    if (!canRemove)
-      this._removeButton.disabled = true;
-    if (!canEdit)
-      this._editButton.disabled = true;
-  },
-  
-  _lastSortProperty : "",
-  _lastSortAscending: false,
-  sort: function (aProperty) 
-  {
-    var ascending = (aProperty == this._lastSortProperty) ? !this._lastSortAscending : true;
-    function sortByProperty(a, b) 
-    {
-      return a[aProperty].toLowerCase().localeCompare(b[aProperty].toLowerCase());
-    }
-    function sortByExtension(a, b)
-    {
-      if (!a.hasExtension && b.hasExtension)
-        return 1;
-      if (!b.hasExtension && a.hasExtension)
-        return -1;
-      return a.extension.toLowerCase().localeCompare(b.extension.toLowerCase());
-    }
-    // Sort the Filtered List, if in Filtered mode
-    if (!this._view._filtered) { 
-      this._view.activeCollection.sort(aProperty == "extension" ? sortByExtension : sortByProperty);
-      if (!ascending)
-        this._view.activeCollection.reverse();
-    }
-
-    this._view.selection.clearSelection();
-    this._view.selection.select(0);
-    this._tree.treeBoxObject.invalidate();
-    this._tree.treeBoxObject.ensureRowIsVisible(0);
-
-    this._lastSortAscending = ascending;
-    this._lastSortProperty = aProperty;
-  },
-  
-  clearFilter: function ()
-  {    
-    // Clear the Filter and the Tree Display
-    document.getElementById("filter").value = "";
-    this._view._filtered = false;
-    this._view._filterSet = [];
-
-    // Just reload the list to make sure deletions are respected
-    this._loadView();
-    this._updateRowCount(this._updateExclusions());
-
-    // Restore selection
-    this._view.selection.clearSelection();
-    for (var i = 0; i < this._lastSelectedRanges.length; ++i) {
-      var range = this._lastSelectedRanges[i];
-      this._view.selection.rangedSelect(range.min, range.max, true);
-    }
-    this._lastSelectedRanges = [];
-
-    document.getElementById("actionsIntro").value = this._bundle.getString("actionsAll");
-    document.getElementById("clearFilter").disabled = true;
-    document.getElementById("filter").focus();
-  },
-  
-  _actionMatchesFilter: function (aAction)
-  {
-    return aAction.extension.toLowerCase().indexOf(this._view._filterValue) != -1 ||
-           aAction.typeName.toLowerCase().indexOf(this._view._filterValue) != -1 || 
-           aAction.type.toLowerCase().indexOf(this._view._filterValue) != -1 ||
-           aAction.action.toLowerCase().indexOf(this._view._filterValue) != -1;
-  },
-  
-  _filterActions: function (aFilterValue)
-  {
-    this._view._filterValue = aFilterValue;
-    var actions = [];
-    var collection = this._view._usingExclusionSet ? this._view._exclusionSet : this._actions;
-    for (var i = 0; i < collection.length; ++i) {
-      var action = collection[i];
-      if (this._actionMatchesFilter(action)) 
-        actions.push(action);
-    }
-    return actions;
-  },
-  
-  _lastSelectedRanges: [],
-  _saveState: function ()
-  {
-    // Save selection
-    var seln = this._view.selection;
-    this._lastSelectedRanges = [];
-    var rangeCount = seln.getRangeCount();
-    for (var i = 0; i < rangeCount; ++i) {
-      var min = {}; var max = {};
-      seln.getRangeAt(i, min, max);
-      this._lastSelectedRanges.push({ min: min.value, max: max.value });
-    }
-  },
-  
-  _filterTimeout: -1,
-  onFilterInput: function ()
-  {
-    if (this._filterTimeout != -1)
-      clearTimeout(this._filterTimeout);
-   
-    function filterActions()
-    {
-      var filter = document.getElementById("filter").value.toLowerCase();
-      if (filter == "") {
-        gDownloadActionsWindow.clearFilter();
-        return;
-      }        
-      var view = gDownloadActionsWindow._view;
-      view._filterSet = gDownloadActionsWindow._filterActions(filter);
-      if (!view._filtered) {
-        // Save Display Info for the Non-Filtered mode when we first
-        // enter Filtered mode. 
-        gDownloadActionsWindow._saveState();
-        view._filtered = true;
-      }
-
-      // Clear the display
-      gDownloadActionsWindow._updateRowCount(view._filterSet.length);
-      
-      // if the view is not empty then select the first item
-      if (view.rowCount > 0)
-        view.selection.select(0);
-
-      document.getElementById("actionsIntro").value = gDownloadActionsWindow._bundle.getString("actionsFiltered");
-      document.getElementById("clearFilter").disabled = false;
-    }
-    window.filterActions = filterActions;
-    this._filterTimeout = setTimeout("filterActions();", 500);
-  },
-  
-  onFilterKeyPress: function (aEvent)
-  {
-    if (aEvent.keyCode == 27) // ESC key
-      this.clearFilter();
-  },
-  
-  focusFilterBox: function ()
-  { 
-    var filter = document.getElementById("filter");
-    filter.focus();
-    filter.select();
-  }  
-};
-
deleted file mode 100644
--- a/browser/components/preferences/downloadactions.xul
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0"?>
-
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Firefox Preferences System.
-#
-# The Initial Developer of the Original Code is
-# Ben Goodger.
-# Portions created by the Initial Developer are Copyright (C) 2005
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Ben Goodger <ben@mozilla.org>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-<?xml-stylesheet href="chrome://global/skin/"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
-
-<!DOCTYPE prefwindow [
-  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-  <!ENTITY % downloadactionsDTD SYSTEM "chrome://browser/locale/preferences/downloadactions.dtd">
-  %brandDTD;
-  %downloadactionsDTD;
-]>
-
-<window id="DownloadActionsWindow" class="windowDialog"
-        windowtype="Preferences:DownloadActions"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="gDownloadActionsWindow.init();"
-        onunload="gDownloadActionsWindow.uninit();"
-        title="&downloadactionsWindow.title;"
-        width="&window.width;" height="&window.height;" persist="width height screenX screenY">
-
-  <script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/>
-  <script type="application/x-javascript" src="chrome://browser/content/preferences/downloadactions.js"/>
-
-  <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
-
-  <keyset>
-    <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
-    <key key="&focusSearch1.key;" modifiers="accel" oncommand="gDownloadActionsWindow.focusFilterBox();"/>
-    <key key="&focusSearch2.key;" modifiers="accel" oncommand="gDownloadActionsWindow.focusFilterBox();"/>
-  </keyset>
-           
-  <vbox flex="1" class="contentPane">
-    <hbox align="center">
-      <label accesskey="&filter.accesskey;" control="filter">&filter.label;</label>
-      <textbox id="filter" flex="1" oninput="gDownloadActionsWindow.onFilterInput();" 
-              onkeypress="gDownloadActionsWindow.onFilterKeyPress(event);"/>
-      <button id="clearFilter" icon="clear" label="&clear.label;" accesskey="&clear.accesskey;" 
-              oncommand="gDownloadActionsWindow.clearFilter();" disabled="true"/>
-    </hbox>
-    <separator class="thin"/>
-    <label id="actionsIntro" control="fileHandlersList">
-      &fileTypesDescription.label;
-    </label>
-    <separator class="thin"/>
-    <tree id="fileHandlersList" flex="1"
-          lastSelected="0" persist="lastSelected"
-          onselect="gDownloadActionsWindow.onSelectionChanged();"
-          ondblclick="gDownloadActionsWindow.editFileHandler();">
-      <treechildren id="extensionChildren"/>
-      <treecols>
-        <treecol id="fileExtension" ignoreincolumnpicker="true"
-                  class="sortDirectionIndicator" persist="width"
-                  label="&fileExtensionColumn.label;" accesskey="&fileExtensionColumn.accesskey;"
-                  onclick="gDownloadActionsWindow.sort('extension');"/>
-        <treecol id="fileType" flex="1"
-                  class="sortDirectionIndicator" persist="width"
-                  label="&fileTypeColumn.label;" accesskey="&fileTypeColumn.accesskey;"
-                  onclick="gDownloadActionsWindow.sort('typeName');"/>
-        <splitter class="tree-splitter" />
-        <treecol id="fileMIMEType" flex="1" hidden="true"
-                  class="sortDirectionIndicator" persist="width"
-                  label="&fileMIMETypeColumn.label;" accesskey="&fileMIMETypeColumn.accesskey;"
-                  onclick="gDownloadActionsWindow.sort('type');"/>
-        <splitter class="tree-splitter" />
-        <treecol id="fileHandler" flex="1"
-                  class="sortDirectionIndicator" persist="width"
-                  label="&fileHandlerColumn.label;" accesskey="&fileHandlerColumn.accesskey;"
-                  onclick="gDownloadActionsWindow.sort('action');"/>                
-        <splitter class="tree-splitter" />
-      </treecols>
-    </tree>
-  </vbox>
-  <separator class="thin"/>
-  <hbox>
-    <hbox flex="1" class="actionButtons">
-      <button id="removeFileHandler" icon="remove"
-              label="&remove.label;" accesskey="&remove.accesskey;"
-              oncommand="gDownloadActionsWindow.removeFileHandler();"/>
-      <button id="editFileHandler"
-              label="&edit.label;" accesskey="&edit.accesskey;"
-              oncommand="gDownloadActionsWindow.editFileHandler();"/>
-      <spacer flex="1"/>
-#ifndef XP_MACOSX
-      <button oncommand="close();" icon="close"
-              label="&button.close.label;" accesskey="&button.close.accesskey;"/>
-#endif
-    </hbox>
-    <resizer dir="bottomright"/>
-  </hbox>
-</window>
-
deleted file mode 100644
--- a/browser/components/preferences/feeds.js
+++ /dev/null
@@ -1,383 +0,0 @@
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Firefox Preferences System.
-#
-# The Initial Developer of the Original Code is
-# Jeff Walden <jwalden+code@mit.edu>.
-# Portions created by the Initial Developer are Copyright (C) 2006
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Asaf Romano <mozilla.mano@sent.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-#ifndef XP_MACOSX
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-var TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
-const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-#endif
-
-/*
- * Preferences:
- *
- * browser.feeds.handler
- * - "bookmarks", "reader" (clarified further using the .default preference),
- *   or "ask" -- indicates the default handler being used to process feeds
- *
- * browser.feeds.handler.default
- * - "bookmarks", "client" or "web" -- indicates the chosen feed reader used
- *   to display feeds, either transiently (i.e., when the "use as default"
- *   checkbox is unchecked, corresponds to when browser.feeds.handler=="ask")
- *   or more permanently (i.e., the item displayed in the dropdown in Feeds
- *   preferences)
- *
- * browser.feeds.handler.webservice
- * - the URL of the currently selected web service used to read feeds
- *
- * browser.feeds.handlers.application
- * - nsILocalFile, stores the current client-side feed reading app if one has
- *   been chosen
- */
-   
-const PREF_SELECTED_APP    = "browser.feeds.handlers.application";
-const PREF_SELECTED_WEB    = "browser.feeds.handlers.webservice";
-const PREF_SELECTED_ACTION = "browser.feeds.handler";
-const PREF_SELECTED_READER = "browser.feeds.handler.default";
-
-var gFeedsPane = {
-  element: function(aID) {
-    return document.getElementById(aID);
-  },
-
-  /* ........ QueryInterface .............. */
-  QueryInterface: function(aIID) {
-    if (aIID.equals(Ci.nsISupports) ||
-        aIID.equals(Ci.nsIObserver) ||
-        aIID.equals(Ci.nsIDOMEventListener))
-      return this;
-      
-    throw Cr.NS_ERROR_NO_INTERFACE;
-  },
-
-  /**
-   * See nsIObserver
-   */
-  observe: function(aSubject, aTopic, aData) {
-    if (aTopic != "nsPref:changed" || aData != PREF_SELECTED_WEB)
-      return;
-
-    if (this.element(PREF_SELECTED_ACTION).value == "reader") {
-      var wccr = 
-        Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
-        getService(Ci.nsIWebContentConverterService);
-      var handlerURL = this.element(PREF_SELECTED_WEB).valueFromPreferences;
-      var handler =
-        wccr.getWebContentHandlerByURI(TYPE_MAYBE_FEED, handlerURL);
-      if (handler)
-        wccr.setAutoHandler(TYPE_MAYBE_FEED, handler);
-    }
-  },
-
-  /**
-   * See nsIDOMEventListener
-   */
-  handleEvent: function(aEvent) {
-    if (aEvent.type == "unload") {
-      var prefBranch = Cc["@mozilla.org/preferences-service;1"].
-        getService(Ci.nsIPrefBranch2);
-      prefBranch.removeObserver(PREF_SELECTED_WEB, this);
-      window.removeEventListener("unload", this, false);
-    }
-  },
-
-  /**
-   * Initializes this.
-   */
-  init: function () {
-    var _delayedPaneLoad = function(self) {
-      self._initFeedReaders();
-      self.updateSelectedReader();
-    }
-    setTimeout(_delayedPaneLoad, 0, this);
-
-    // For web readers, we need to call setAutoHandler if the
-    // preview page should be skipped (i.e. PREF_SELECTED_ACTION="reader")
-    // To do so, we've to add a pref-observer in order to be notified on
-    // actual pref-changes (i.e. not on pref changes which may not take
-    // affect when the prefwindow is closed)
-    var prefBranch = Cc["@mozilla.org/preferences-service;1"].
-      getService(Ci.nsIPrefBranch2);
-
-    prefBranch.addObserver(PREF_SELECTED_WEB, this, false);
-    window.addEventListener("unload", this, false);
-  },
-
-  /**
-   * Populates the UI list of available feed readers.
-   */
-  _initFeedReaders: function() {
-    this.updateSelectedApplicationInfo();
-
-    var readersList = this.element("readers");
-
-    // List the system default feed reader if it is
-    // not the last-selected application already
-    try {
-      var systemDefaultReader = Cc["@mozilla.org/browser/shell-service;1"].
-                                getService(Ci.nsIShellService).
-                                defaultFeedReader;
-
-      var defaultSystemReaderFilefield = this.element("defaultSystemReaderFilefield");
-      defaultSystemReaderFilefield.file = systemDefaultReader;
-      var selectedAppFile = this.element("selectedAppFilefield").file;
-      if (!selectedAppFile || defaultSystemReaderFilefield.file.path !=
-          selectedAppFile.path) {
-        var defaultReaderItem = document.createElementNS(kXULNS, "listitem");
-        defaultReaderItem.id = "defaultSystemReaderListitem";
-        defaultReaderItem.className = "listitem-iconic";
-        defaultReaderItem.setAttribute("label", defaultSystemReaderFilefield.label);
-        defaultReaderItem.setAttribute("image", defaultSystemReaderFilefield.image);
-        readersList.appendChild(defaultReaderItem);
-      }
-    }
-    catch(ex) { /* no default reader */ }
-
-    // List of web handlers
-    var wccr = 
-        Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
-        getService(Ci.nsIWebContentConverterService);
-    var handlers = wccr.getContentHandlers(TYPE_MAYBE_FEED, {});
-    if (handlers.length == 0)
-      return;
-
-    var ios = 
-        Cc["@mozilla.org/network/io-service;1"].
-        getService(Ci.nsIIOService);
-    for (var i = 0; i < handlers.length; ++i) {
-      var row = document.createElementNS(kXULNS, "listitem");
-      row.className = "listitem-iconic";
-      row.setAttribute("label", handlers[i].name);
-      row.setAttribute("webhandlerurl", handlers[i].uri);
-
-      var uri = ios.newURI(handlers[i].uri, null, null);
-      if (/^https?/.test(uri.scheme))
-        row.setAttribute("image", uri.prePath + "/favicon.ico");
-
-      readersList.appendChild(row);
-    }
-  },
-
-  /**
-   * Updates the label and image of the client feed reader listitem
-   */
-  updateSelectedApplicationInfo: function() {
-    var appItemCell = this.element("selectedApplicationCell");
-    var selectedAppFilefield = this.element("selectedAppFilefield");
-    selectedAppFilefield.file = this.element(PREF_SELECTED_APP).value;
-    if (selectedAppFilefield.file) {
-      appItemCell.setAttribute("label", selectedAppFilefield.label);
-      appItemCell.setAttribute("image", selectedAppFilefield.image);
-    }
-    else {
-      var noAppString =
-        this.element("stringbundle").getString("noApplicationSelected");
-      appItemCell.setAttribute("label", noAppString);
-      appItemCell.setAttribute("image", "");
-    }
-  },
-
-  /**
-   * Selects a item in the list without triggering a preference change.
-   *
-   * @param aItem
-   *        the listitem to be selected
-   */
-  _silentSelectReader: function(aItem) {
-    var readers = this.element("readers");
-    readers.setAttribute("suppressonselect", "true");
-    readers.selectItem(aItem);
-    readers.removeAttribute("suppressonselect");
-  },
-
-  /**
-   * Helper for updateSelectedReader. Syncs the selected item in the readers
-   * list with value stored invalues stored in PREF_SELECTED_WEB
-   */
-  _updateSelectedWebHandlerItem: function() {
-    // We should select the new web handler only if the default handler
-    // is "web"
-    var readers = this.element("readers")
-    var readerElts =
-        readers.getElementsByAttribute("webhandlerurl",
-                                       this.element(PREF_SELECTED_WEB).value);
-
-    // XXXmano: handle the addition of a new web handler
-    if (readerElts.length > 0)
-      this._silentSelectReader(readerElts[0]);
-  },
-
-  /**
-   * Syncs the selected item in the readers list with the values stored in
-   * preferences.
-   */
-  updateSelectedReader: function() {
-    var defaultReader = this.element(PREF_SELECTED_READER).value ||
-                        "bookmarks";
-    switch (defaultReader) {
-      case "bookmarks":
-        this._silentSelectReader(this.element("liveBookmarksListItem"));
-        break;
-      case "client":
-#ifdef XP_WIN
-        // Keep the system default feed reader item selected if the
-        // last-selected application is the the system default feed reader
-        // and if it is already selected
-        var currentItem = this.element("readers").currentItem;
-        if (currentItem && currentItem.id == "defaultSystemReaderListitem") {
-          var defaultSystemReaderFile = this.element("defaultSystemReaderFilefield").file;
-          var selectedAppFile = this.element("selectedAppFilefield").file;
-          if (selectedAppFile && defaultSystemReaderFile &&
-              defaultSystemReaderFile.path == selectedAppFile.path)
-            break;
-        }
-#endif
-
-        this._silentSelectReader(this.element("selectedApplicationListitem"));
-        break;
-      case "web":
-        this._updateSelectedWebHandlerItem();
-        break;
-    }
-  },
-
-  /**
-   * Displays a prompt from which the user may choose an a (client) feed reader.
-   */
-  chooseClientApp: function () {
-    var fp = Cc["@mozilla.org/filepicker;1"]
-               .createInstance(Ci.nsIFilePicker);
-    fp.init(window, document.title, Ci.nsIFilePicker.modeOpen);
-    fp.appendFilters(Ci.nsIFilePicker.filterApps);
-    if (fp.show() == Ci.nsIFilePicker.returnOK && fp.file) {
-      // XXXben - we need to compare this with the running instance executable
-      //          just don't know how to do that via script...
-      // XXXmano TBD: can probably add this to nsIShellService
-#ifdef XP_WIN
-#expand       if (fp.file.leafName == "__MOZ_APP_NAME__.exe")
-#else
-#ifdef XP_MACOSX
-#expand       if (fp.file.leafName == "__MOZ_APP_DISPLAYNAME__.app")
-#else
-#expand       if (fp.file.leafName == "__MOZ_APP_NAME__-bin")
-#endif
-#endif
-        return;
-
-      this.element(PREF_SELECTED_APP).value = fp.file;
-      this.element(PREF_SELECTED_READER).value = "client";
-    }
-  },
-
-  /**
-   * Disables the readers list if "Show preview..." is selected, enables
-   * it otherwise.
-   */
-  onReadingMethodSelect: function() {
-    var disableList = this.element("readingMethod").value == "ask";
-    this.element("readers").disabled = disableList;
-    this.element("chooseClientApp").disabled = disableList;
-  },
-
-  /**
-   * Maps the value of PREF_SELECTED_ACTION to the parallel
-   * value in the radiogroup
-   */
-  onReadingMethodSyncFromPreference: function() {
-    var pref = this.element(PREF_SELECTED_ACTION);
-    var newVal = pref.instantApply ? pref.valueFromPreferences : pref.value;
-    if (newVal != "ask")
-      return "reader";
-
-    return "ask";
-  },
-
-  /**
-   * Returns the value to be used for PREF_SELECTED_ACTION
-   * according to the current UI state.
-   */
-  onReadingMethodSyncToPreference: function() {
-    var readers = this.element("readers");
-
-    // A reader must be choosed in order to skip the preview page
-    if (this.element("readingMethod").value == "ask" ||
-        !readers.currentItem)
-      return "ask";
-
-    if (readers.currentItem.id == "liveBookmarksListItem")
-      return "bookmarks";
-
-    return "reader";
-  },
-
-  /**
-   * Syncs PREF_SELECTED_READER with the selected item in the readers list
-   * Also updates PREF_SELECTED_ACTION if necessary
-   */
-  writeSelectedFeedReader: function() {
-    // Force update of the action pref. This is needed for the case in which
-    // the user flipped from a reader to live bookmarks or vice-versa
-    this.element(PREF_SELECTED_ACTION).value =
-      this.onReadingMethodSyncToPreference();
-
-    var currentItem = this.element("readers").currentItem;
-    if (currentItem.hasAttribute("webhandlerurl")) {
-      this.element(PREF_SELECTED_WEB).value =
-        currentItem.getAttribute("webhandlerurl");
-      this.element(PREF_SELECTED_READER).value = "web";
-    }
-    else {
-      switch (currentItem.id) {
-        case "liveBookmarksListItem":
-          this.element(PREF_SELECTED_READER).value = "bookmarks";
-          break;
-        case "selectedApplicationListitem":
-          // PREF_SELECTED_APP is saved in chooseClientApp
-          this.element(PREF_SELECTED_READER).value = "client";
-          break;
-#ifdef XP_WIN
-        case "defaultSystemReaderListitem":
-          this.element(PREF_SELECTED_APP).value = this.element("defaultSystemReaderFilefield").file;
-          this.element(PREF_SELECTED_READER).value = "client";
-          break;
-#endif
-      }
-    }
-  }
-};
deleted file mode 100644
--- a/browser/components/preferences/feeds.xul
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0"?>
-
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Firefox Preferences System.
-#
-# The Initial Developer of the Original Code is
-# Jeff Walden <jwalden+code@mit.edu>.
-# Portions created by the Initial Developer are Copyright (C) 2006
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Asaf Romano <mozilla.mano@sent.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-<!DOCTYPE overlay [
-  <!ENTITY % feedsDTD SYSTEM "chrome://browser/locale/preferences/feeds.dtd">
-  %feedsDTD;
-]>
-
-<overlay id="FeedsPaneOverlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-         xmlns:aaa="http://www.w3.org/2005/07/aaa">
-
-  <prefpane id="paneFeeds"
-            onpaneload="gFeedsPane.init();"
-            helpTopic="prefs-feeds"
-            helpURI="chrome://browser/locale/help/help.rdf">
-
-    <preferences id="feedsPreferences">
-      <preference id="browser.feeds.handler"
-                  name="browser.feeds.handler"
-                  type="string"/>
-      <preference id="browser.feeds.handler.default"
-                  name="browser.feeds.handler.default"
-                  onchange="gFeedsPane.updateSelectedReader();"
-                  type="string"/>
-      <preference id="browser.feeds.handlers.application"
-                  name="browser.feeds.handlers.application"
-                  onchange="gFeedsPane.updateSelectedApplicationInfo();"
-                  type="file"/>
-      <preference id="browser.feeds.handlers.webservice"
-                  name="browser.feeds.handlers.webservice"
-                  onchange="gFeedsPane.updateSelectedReader();"
-                  type="string"/>
-    </preferences>
-    
-    <script type="application/x-javascript" src="chrome://browser/content/preferences/feeds.js"/>
-
-    <filefield class="indent" id="selectedAppFilefield" disabled="true" hidden="true"/>
-#ifdef XP_WIN
-    <filefield class="indent" id="defaultSystemReaderFilefield" disabled="true" hidden="true"/>
-#endif
-
-    <stringbundle id="stringbundle" src="chrome://browser/locale/preferences/feeds.properties"/>
-
-    <label value="&feedClick.label;"/>
-    <radiogroup id="readingMethod"
-                class="indent"
-                preference="browser.feeds.handler"
-                onsyncfrompreference="return gFeedsPane.onReadingMethodSyncFromPreference();"
-                onsynctopreference="return gFeedsPane.onReadingMethodSyncToPreference();"
-                onselect="gFeedsPane.onReadingMethodSelect();">
-      <radio value="ask"
-             label="&showPreview.label;"
-             accesskey="&showPreview.accesskey;"/>
-      <radio value="reader" id="useReader"
-             label="&subscribeUsing.label;"
-             accesskey="&subscribeUsing.accesskey;"
-             aaa:labelledby="useReader readers"/>
-      <hbox id="readerContainer" class="indent" flex="1">
-        <listbox id="readers" rows="5" flex="1"
-                 aaa:labelledby="useReader"
-                 onselect="gFeedsPane.writeSelectedFeedReader(); event.stopPropagation();">
-          <listcols>
-            <listcol flex="1"/>
-            <listcol/>
-          </listcols>
-          <listitem id="liveBookmarksListItem"
-                    label="&liveBookmarks.label;"
-                    class="listitem-iconic"
-                    image="chrome://browser/skin/page-livemarks.png"/>
-          <listitem id="selectedApplicationListitem" allowevents="true">
-            <listcell id="selectedApplicationCell" class="listcell-iconic"/>
-            <listcell id="chooseClientAppCell">
-              <button id="chooseClientApp"
-                      label="&chooseApplication.label;"
-                      accesskey="&chooseApplication.accesskey;"
-                      oncommand="gFeedsPane.chooseClientApp();"/>
-            </listcell>
-          </listitem>
-        </listbox>
-      </hbox>
-    </radiogroup>
-  </prefpane>
-</overlay>
new file mode 100755
--- /dev/null
+++ b/browser/components/preferences/handlers.css
@@ -0,0 +1,66 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Mozilla browser.
+ *
+ * The Initial Developer of the Original Code is Mozilla.
+ * Portions created by the Initial Developer are Copyright (C) 2007
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Myk Melez <myk@mozilla.org>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+richlistitem {
+  -moz-binding: url("chrome://browser/content/preferences/handlers.xml#handler");
+}
+
+richlistitem[selected="true"] {
+  -moz-binding: url("chrome://browser/content/preferences/handlers.xml#handler-selected");
+}
+
+/**
+ * Somewhat line up the actions menu with action labels above and below it.
+ * FIXME: to really line this up, equalize the distance from the left side
+ * of the action box to the left side of the icon for both the menu and the
+ * non-menu versions of the action box.  Also make sure the labels are the
+ * same distance away from the icons.
+ */
+.actionsMenu {
+  margin-left: 0;
+}
+
+/**
+ * Make the icons appear and pad them a bit.
+ * Note: we display the icon box for every item whether or not it has an icon
+ * so the labels of all the items align vertically.
+ */
+.actionsMenu > menupopup > menuitem > .menu-iconic-left {
+  display: -moz-box;
+  min-width: 16px;
+  -moz-padding-start: 2px;
+  -moz-padding-end: 2px;
+}
new file mode 100755
--- /dev/null
+++ b/browser/components/preferences/handlers.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is the Mozilla browser.
+   -
+   - The Initial Developer of the Original Code is Mozilla.
+   - Portions created by the Initial Developer are Copyright (C) 2007
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Myk Melez <myk@mozilla.org>
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE overlay [
+  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+  <!ENTITY % applicationsDTD SYSTEM "chrome://browser/locale/preferences/applications.dtd">
+  %brandDTD;
+  %applicationsDTD;
+]>
+
+<bindings id="handlerBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="handler-base" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
+    <implementation>
+      <property name="type" readonly="true">
+        <getter>
+          return this.getAttribute("type");
+        </getter>
+      </property>
+    </implementation>
+  </binding>
+
+  <binding id="handler" extends="chrome://browser/content/preferences/handlers.xml#handler-base">
+    <content>
+      <xul:hbox flex="1" equalsize="always">
+        <xul:hbox flex="1" align="center">
+          <xul:image xbl:inherits="src=typeIcon" height="16" width="16"/>
+          <xul:label flex="1" crop="end" xbl:inherits="value=typeDescription"/>
+        </xul:hbox>
+        <xul:hbox flex="1" align="center">
+          <xul:image xbl:inherits="src=actionIcon" height="16" width="16"/>
+          <xul:label flex="1" crop="end" xbl:inherits="value=actionDescription"/>
+        </xul:hbox>
+      </xul:hbox>
+    </content>
+  </binding>
+
+  <binding id="handler-selected" extends="chrome://browser/content/preferences/handlers.xml#handler-base">
+    <content>
+      <xul:hbox flex="1" equalsize="always">
+        <xul:hbox flex="1" align="center">
+          <xul:image xbl:inherits="src=typeIcon" height="16" width="16"/>
+          <xul:label flex="1" crop="end" xbl:inherits="value=typeDescription"/>
+        </xul:hbox>
+        <xul:hbox flex="1">
+          <xul:menulist class="actionsMenu" flex="1" crop="end" selectedIndex="1"
+                        oncommand="gApplicationsPane.onSelectAction(event)">
+            <xul:menupopup/>
+          </xul:menulist>
+        </xul:hbox>
+      </xul:hbox>
+    </content>
+
+    <implementation>
+      <constructor>
+        gApplicationsPane.rebuildActionsMenu();
+      </constructor>
+    </implementation>
+
+  </binding>
+
+</bindings>
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -1,28 +1,26 @@
 browser.jar:
 *   content/browser/preferences/advanced.xul
 *   content/browser/preferences/advanced.js
 *   content/browser/preferences/advanced-scripts.xul
-*   content/browser/preferences/changeaction.xul
-*   content/browser/preferences/changeaction.js
+*   content/browser/preferences/applications.xul
+*   content/browser/preferences/applications.js
 *   content/browser/preferences/colors.xul
 *   content/browser/preferences/cookies.xul
 *   content/browser/preferences/cookies.js
 *   content/browser/preferences/content.xul
 *   content/browser/preferences/content.js
 *   content/browser/preferences/connection.xul
 *   content/browser/preferences/connection.js
-*   content/browser/preferences/downloadactions.xul
-*   content/browser/preferences/downloadactions.js
 *   content/browser/preferences/fallbackEULA.xhtml
-*   content/browser/preferences/feeds.xul
-*   content/browser/preferences/feeds.js
 *   content/browser/preferences/fonts.xul
 *   content/browser/preferences/fonts.js
+*   content/browser/preferences/handlers.xml
+*   content/browser/preferences/handlers.css
 *   content/browser/preferences/languages.xul
 *   content/browser/preferences/languages.js
 *   content/browser/preferences/main.xul
 *   content/browser/preferences/main.js
 *   content/browser/preferences/permissions.xul
 *   content/browser/preferences/permissions.js
 *   content/browser/preferences/permissionsutils.js
 *   content/browser/preferences/phishEULA.xul
--- a/browser/components/preferences/preferences.xul
+++ b/browser/components/preferences/preferences.xul
@@ -38,16 +38,23 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 <?xml-stylesheet href="chrome://global/skin/global.css"?>
 <?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
 
+<!-- XXX This should be in applications.xul, but bug 393953 means putting it
+   - there causes the Applications pane not to work the first time you open
+   - the Preferences dialog in a browsing session, so we work around the problem
+   - by putting it here instead.
+   -->
+<?xml-stylesheet href="chrome://browser/content/preferences/handlers.css"?>
+
 <!DOCTYPE prefwindow [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
 <!ENTITY % preferencesDTD SYSTEM "chrome://browser/locale/preferences/preferences.dtd">
 %brandDTD;
 %preferencesDTD;
 ]>
 
 #ifdef XP_WIN
@@ -88,18 +95,18 @@
                   src="chrome://browser/locale/preferences/preferences.properties"/>
 
     <prefpane id="paneMain" label="&paneMain.title;"
               src="chrome://browser/content/preferences/main.xul"/>
     <prefpane id="paneTabs" label="&paneTabs.title;"
               src="chrome://browser/content/preferences/tabs.xul"/>
     <prefpane id="paneContent" label="&paneContent.title;"
               src="chrome://browser/content/preferences/content.xul"/>
-    <prefpane id="paneFeeds" label="&paneFeeds.title;"
-              src="chrome://browser/content/preferences/feeds.xul"/>
+    <prefpane id="paneApplications" label="&paneApplications.title;"
+              src="chrome://browser/content/preferences/applications.xul"/>
     <prefpane id="panePrivacy" label="&panePrivacy.title;"
               src="chrome://browser/content/preferences/privacy.xul"/>
     <prefpane id="paneSecurity" label="&paneSecurity.title;"
               src="chrome://browser/content/preferences/security.xul"/>
     <prefpane id="paneAdvanced" label="&paneAdvanced.title;"
               src="chrome://browser/content/preferences/advanced.xul"/>
 
 #ifdef XP_MACOSX
new file mode 100755
--- /dev/null
+++ b/browser/locales/en-US/chrome/browser/preferences/applications.dtd
@@ -0,0 +1,17 @@
+<!ENTITY  prefpane.label          "Here you can configure &brandShortName; to let your favorite applications handle different types of content.">
+<!ENTITY  filterActive.label      "The following entries match your search:">
+
+<!ENTITY  typeColumn.label        "Content Type">
+<!ENTITY  typeColumn.accesskey    "T">
+
+<!ENTITY  actionColumn.label      "Application">
+<!ENTITY  actionColumn.accesskey  "A">
+
+<!ENTITY  focusSearch1.key        "f">
+<!ENTITY  focusSearch2.key        "k">
+
+<!ENTITY  filter.label            "Search:">
+<!ENTITY  filter.accesskey        "S">
+
+<!ENTITY  clear.label             "Clear">
+<!ENTITY  clear.accesskey         "l">
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/changeaction.dtd
+++ /dev/null
@@ -1,23 +0,0 @@
-<!ENTITY  changeAction.title                  "Change Action">
-<!ENTITY window.width                         "36em">
-
-<!ENTITY  whenDownloading.label               "When downloading files like this:">
-
-<!ENTITY  openDefault.label                   "Open them with the default application:">
-<!ENTITY  openDefault.accesskey               "O">
-<!ENTITY  openApplication.label               "Open them with this application:">
-<!ENTITY  openApplication.accesskey           "e">
-<!ENTITY  changeApp.label                     "Browse...">
-<!ENTITY  changeApp.accesskey                 "B">
-<!ENTITY  saveToDisk.label                    "Save them on my computer">
-<!ENTITY  saveToDisk.accesskey                "S">
-<!ENTITY  saveToDefaultFolder.label           "in the default download folder">
-<!ENTITY  saveToDefaultFolder.accesskey       "d">
-<!ENTITY  saveToThisFolder.label              "in this folder:">
-<!ENTITY  saveToThisFolder.accesskey          "h">
-<!ENTITY  chooseFolder.label                  "Browse...">
-<!ENTITY  chooseFolder.accesskey              "w">
-<!ENTITY  saveToAskMe.label                   "ask me where to save the file">
-<!ENTITY  saveToAskMe.accesskey               "a">
-<!ENTITY  usePlugin.label                     "Use this Plugin:">
-<!ENTITY  usePlugin.accesskey                 "P">
--- a/browser/locales/en-US/chrome/browser/preferences/content.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/content.dtd
@@ -24,14 +24,8 @@
 <!ENTITY  defaultSize.label           "Size:">
 <!ENTITY  defaultSize.accesskey       "S">
 
 <!ENTITY  advancedFonts.label         "Advanced...">
 <!ENTITY  advancedFonts.accesskey     "A">
 
 <!ENTITY  colors.label                "Colors...">
 <!ENTITY  colors.accesskey            "C">
-
-<!ENTITY fileTypes.label              "File Types">
-
-<!ENTITY configureFileTypes.label     "Configure how &brandShortName; handles certain types of files">
-<!ENTITY manage.label                 "Manage...">
-<!ENTITY manage.accesskey             "M">
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/downloadactions.dtd
+++ /dev/null
@@ -1,32 +0,0 @@
-<!ENTITY  downloadactionsWindow.title         "Download Actions">
-<!ENTITY window.width                         "480">
-<!ENTITY window.height                        "310">
-
-<!ENTITY  fileTypesDescription.label          "Automatically perform the associated Action with each of the following file types:">
-
-<!ENTITY  fileHandlerColumn.label             "Action">
-<!ENTITY  fileHandlerColumn.accesskey         "A">
-<!ENTITY  fileTypeColumn.label                "File Type">
-<!ENTITY  fileTypeColumn.accesskey            "T">
-<!ENTITY  fileMIMETypeColumn.label            "MIME Type">
-<!ENTITY  fileMIMETypeColumn.accesskey        "M">
-<!ENTITY  fileExtensionColumn.label           "Extension">
-<!ENTITY  fileExtensionColumn.accesskey       "E">
-
-<!ENTITY  remove.label                        "Remove Action">
-<!ENTITY  remove.accesskey                    "R">
-<!ENTITY  edit.label                          "Change Action...">
-<!ENTITY  edit.accesskey                      "C">
-
-<!ENTITY  windowClose.key                     "w">
-<!ENTITY  focusSearch1.key                    "f">
-<!ENTITY  focusSearch2.key                    "k">
-
-<!ENTITY  filter.label                        "Search:">
-<!ENTITY  filter.accesskey                    "S">
-<!ENTITY  clear.label                         "Clear">
-<!ENTITY  clear.accesskey                     "l">
-
-<!ENTITY  button.close.label                  "Close">
-<!ENTITY  button.close.accesskey              "o">
-
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/feeds.dtd
+++ /dev/null
@@ -1,8 +0,0 @@
-<!ENTITY  feedClick.label             "When I click on a web feed:">
-<!ENTITY  showPreview.label           "Show me a preview and ask me which Feed Reader to use">
-<!ENTITY  showPreview.accesskey       "S">
-<!ENTITY  subscribeUsing.label        "Subscribe to the feed using:">
-<!ENTITY  subscribeUsing.accesskey    "u">
-<!ENTITY  liveBookmarks.label         "Live Bookmarks">
-<!ENTITY  chooseApplication.label     "Choose Application...">
-<!ENTITY  chooseApplication.accesskey     "C">
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/feeds.properties
+++ /dev/null
@@ -1,1 +0,0 @@
-noApplicationSelected=No Application Selected
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.dtd
@@ -5,12 +5,12 @@
      Luna since widget heights are different based on the OS theme -->
 <!ENTITY  prefWin.styleWin        "width: 42em; min-height: 44em;">
 <!ENTITY  prefWindow.styleMac     "width: 47em;">
 <!ENTITY  prefWin.styleGNOME      "width: 42em; min-height: 44.5em;">
 
 <!ENTITY  paneMain.title          "Main">
 <!ENTITY  paneTabs.title          "Tabs">
 <!ENTITY  paneContent.title       "Content">
-<!ENTITY  paneFeeds.title         "Feeds">
+<!ENTITY  paneApplications.title  "Applications">
 <!ENTITY  panePrivacy.title       "Privacy">
 <!ENTITY  paneSecurity.title      "Security">
 <!ENTITY  paneAdvanced.title      "Advanced">
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -38,39 +38,29 @@ languageRegionCodeFormat=%1$S/%2$S  [%3$
 languageCodeFormat=%1$S  [%2$S]
 
 #### Downloads
 
 desktopFolderName=Desktop
 downloadsFolderName=Downloads
 chooseDownloadFolderTitle=Choose Download Folder:
 
-#### Download Actions
+#### Applications
 
-extensionNone=(NONE)
-removeButtonSingle=Remove Action
-removeButtonMultiple=Remove Actions
-removeTitleSingle=Remove Action
-removeTitleMultiple=Remove Actions
-removeMessageSingle=The selected Action will no longer be performed when files of the affected types are downloaded. Are you sure you want to remove this Action?
-removeMessageMultiple=The selected Actions will no longer be performed when files of the affected types are downloaded. Are you sure you want to remove these Actions?
+removeType=Remove this entry...
+removeButton=Remove Entry
+removeTitle=Remove Entry
+removeMessage=If you remove this entry, Firefox will ask you what to do next time you access content of this type.  Are you sure you want to remove this entry?
 fileEnding=%S file
 saveToDisk=Save to Disk
-openWith=Open with %S
-actionsFiltered=The following Actions match your search:
-actionsAll=Automatically perform the associated Action with each of the following file types:
-
-
-#### Change Action
-
-extensionStringFormat=%S, %S
-downloadHelperNoneSelected=None Selected
-pluginHelperNoneAvailable=None Available
+chooseApp=Choose application...
 fpTitleChooseApp=Select Helper Application
-fpTitleChooseDL=Select Download Folder
+webFeed=Web Feed
+alwaysAskAboutFeed=Show me a preview and ask me which Feed Reader to use
+liveBookmarks=Live Bookmarks
 
 #### Cookie Viewer
 
 hostColon=Host:
 domainColon=Domain:
 forSecureOnly=Encrypted connections only
 forAnyConnection=Any type of connection
 AtEndOfSession = at end of session
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -40,25 +40,22 @@
 #endif
     locale/browser/feeds/subscribe.dtd              (%chrome/browser/feeds/subscribe.dtd)
     locale/browser/feeds/subscribe.properties       (%chrome/browser/feeds/subscribe.properties)
     locale/browser/history/history.dtd             (%chrome/browser/history/history.dtd)
     locale/browser/migration/migration.dtd         (%chrome/browser/migration/migration.dtd)
     locale/browser/migration/migration.properties  (%chrome/browser/migration/migration.properties)
     locale/browser/preferences/advanced.dtd           (%chrome/browser/preferences/advanced.dtd)
 *   locale/browser/preferences/advanced-scripts.dtd   (%chrome/browser/preferences/advanced-scripts.dtd)
-    locale/browser/preferences/changeaction.dtd       (%chrome/browser/preferences/changeaction.dtd)
     locale/browser/preferences/colors.dtd             (%chrome/browser/preferences/colors.dtd)
     locale/browser/preferences/cookies.dtd            (%chrome/browser/preferences/cookies.dtd)
     locale/browser/preferences/content.dtd            (%chrome/browser/preferences/content.dtd)
     locale/browser/preferences/connection.dtd         (%chrome/browser/preferences/connection.dtd)
-    locale/browser/preferences/downloadactions.dtd    (%chrome/browser/preferences/downloadactions.dtd)
+    locale/browser/preferences/applications.dtd       (%chrome/browser/preferences/applications.dtd)
     locale/browser/preferences/fallbackEULA.dtd       (%chrome/browser/preferences/fallbackEULA.dtd)
-    locale/browser/preferences/feeds.dtd              (%chrome/browser/preferences/feeds.dtd)
-    locale/browser/preferences/feeds.properties       (%chrome/browser/preferences/feeds.properties)
     locale/browser/preferences/fonts.dtd              (%chrome/browser/preferences/fonts.dtd)
     locale/browser/preferences/main.dtd               (%chrome/browser/preferences/main.dtd)
     locale/browser/preferences/languages.dtd          (%chrome/browser/preferences/languages.dtd)
     locale/browser/preferences/permissions.dtd        (%chrome/browser/preferences/permissions.dtd)
     locale/browser/preferences/phishEULA.dtd          (%chrome/browser/preferences/phishEULA.dtd)
     locale/browser/preferences/preferences.dtd        (%chrome/browser/preferences/preferences.dtd)
     locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
     locale/browser/preferences/privacy.dtd            (%chrome/browser/preferences/privacy.dtd)
--- a/browser/themes/pinstripe/browser/preferences/preferences.css
+++ b/browser/themes/pinstripe/browser/preferences/preferences.css
@@ -109,24 +109,24 @@ radio[pane=paneContent] {
 }
 
 radio[pane=paneContent]:hover,
 radio[pane=paneContent]:active,
 radio[pane=paneContent][selected="true"] {
 	-moz-image-region: rect(32px, 96px, 64px, 64px);
 }
 
-/* ----- FEEDS BUTTON ----- */
+/* ----- APPLICATIONS BUTTON ----- */
 
-radio[pane=paneFeeds] {
+radio[pane=paneApplications] {
 	-moz-image-region: rect(0px, 128px, 32px, 96px);
 }
-radio[pane=paneFeeds]:hover,
-radio[pane=paneFeeds]:active,
-radio[pane=paneFeeds][selected="true"] {
+radio[pane=paneApplications]:hover,
+radio[pane=paneApplications]:active,
+radio[pane=paneApplications][selected="true"] {
 	-moz-image-region: rect(32px, 128px, 64px, 96px);
 }
 
 /* ----- PRIVACY BUTTON ----- */
 
 radio[pane=panePrivacy] {
 	-moz-image-region: rect(0px, 160px, 32px, 128px);
 }
@@ -271,16 +271,8 @@ caption {
  */
 #autoInstallOptions {
   -moz-margin-start: 20px;
 }
 
 .updateControls {
   -moz-margin-start: 10px;
 }
-
-
-/**
- * Feeds pane
- */
-#chooseClientAppCell {
-  -moz-padding-end: 12px;
-}
--- a/browser/themes/winstripe/browser/preferences/preferences.css
+++ b/browser/themes/winstripe/browser/preferences/preferences.css
@@ -62,21 +62,21 @@ radio[pane=paneTabs][selected="true"] {
 radio[pane=paneContent] {
 	-moz-image-region: rect(0px, 96px,  32px, 64px)
 }
 radio[pane=paneContent]:hover, 
 radio[pane=paneContent][selected="true"]  {
 	-moz-image-region: rect(32px, 96px,  64px, 64px)
 }
 
-radio[pane=paneFeeds] {
+radio[pane=paneApplications] {
 	-moz-image-region: rect(0px, 128px,  32px, 96px)
 }
-radio[pane=paneFeeds]:hover, 
-radio[pane=paneFeeds][selected="true"]  {
+radio[pane=paneApplications]:hover, 
+radio[pane=paneApplications][selected="true"]  {
 	-moz-image-region: rect(32px, 128px,  64px, 96px)
 }
 
 radio[pane=panePrivacy] {
 	-moz-image-region: rect(0px, 160px,  32px, 128px)
 }
 radio[pane=panePrivacy]:hover, 
 radio[pane=panePrivacy][selected="true"]  {
@@ -186,87 +186,13 @@ filefield[disabled="true"] .fileFieldIco
 #cookieInfoBox textbox {
   background-color: transparent;
 }
 
 #cookieInfoGrid {
   background-color: #E9E7E3; 
 }
 
-/* Download Actions Manager */
-#fileExtension {
-  width: 5em; 
-}
-
-#extensionChildren::-moz-tree-image(fileExtension) {
-  margin: 0px 5px 0px 0px;
-}
-
-#typeField {
-  font-weight: bold; 
-}
-
-/* Change Action Dialog */
-#typeIcon {
-  width: 32px;
-  height: 32px;
-  -moz-margin-end: 3px;
-}
-
-#typeField {
-  background-color: transparent;
-  margin-top: 1px !important;
-  margin-bottom: 2px !important;
-  -moz-margin-start: 6px !important;
-  -moz-margin-end: 5px !important;
-}
-
-#extensionField {
-  color: GrayText;
-  font-weight: bold;
-}
-#ChangeActionDialog {
-  padding: 0px;
-}
-
-#ChangeActionDialog .dialog-button-box {
-  padding-top: 8px;
-  padding-bottom: 10px;
-  -moz-padding-start: 8px;
-  -moz-padding-end: 10px;  
-}
-
-#changeActionHeader {
-  border-bottom: 2px groove ThreeDFace;
-  margin: 0px;
-  padding: 10px;
-  background-color: -moz-Field;
-  color: -moz-FieldText;  
-}
-
-#changeActionContent {
-  padding-top: 8px;
-  padding-bottom: 10px;
-  -moz-padding-start: 9px;
-  -moz-padding-end: 10px;
-}
-
-#defaultAppIcon {
-  width: 16px;
-  height: 16px;
-  -moz-margin-start: 2px;
-}
-
-#defaultAppName {
-  -moz-margin-start: 6px !important; 
-  font-weight: bold;
-}
-
-/* Feeds pane */
-#chooseClientAppCell {
-  -moz-padding-end: 12px;
-}
-
 /* bottom-most box containing a groupbox in a prefpane. Prevents the bottom
    of the groupbox from being cutoff */
 .bottomBox {
   padding-bottom: 4px;
 }
--- a/toolkit/mozapps/jar.mn
+++ b/toolkit/mozapps/jar.mn
@@ -3,17 +3,16 @@ toolkit.jar:
 * content/mozapps/downloads/helperApps.js                       (downloads/content/helperApps.js)
 * content/mozapps/downloads/unknownContentType.xul              (downloads/content/unknownContentType.xul)
 * content/mozapps/downloads/overrideHandler.js                  (downloads/content/overrideHandler.js)
 * content/mozapps/downloads/downloads.xul                       (downloads/content/downloads.xul)
 * content/mozapps/downloads/downloads.js                        (downloads/content/downloads.js)
 * content/mozapps/downloads/DownloadProgressListener.js         (downloads/content/DownloadProgressListener.js)
   content/mozapps/downloads/downloads.css                       (downloads/content/downloads.css)
 * content/mozapps/downloads/download.xml                        (downloads/content/download.xml)
-* content/mozapps/preferences/actionsshared.js                  (preferences/actionsshared.js)
 * content/mozapps/preferences/ocsp.js                           (preferences/ocsp.js)
 * content/mozapps/preferences/ocsp.xul                          (preferences/ocsp.xul)
 * content/mozapps/preferences/fontbuilder.js                    (preferences/fontbuilder.js)
 * content/mozapps/preferences/changemp.js                       (preferences/changemp.js)
 * content/mozapps/preferences/changemp.xul                      (preferences/changemp.xul)
 * content/mozapps/preferences/removemp.js                       (preferences/removemp.js)
 * content/mozapps/preferences/removemp.xul                      (preferences/removemp.xul)
   content/mozapps/preferences/preferences.css                   (preferences/preferences.css)
deleted file mode 100644
--- a/toolkit/mozapps/preferences/actionsshared.js
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Download Actions Manager.
-#
-# The Initial Developer of the Original Code is
-# Ben Goodger.
-# Portions created by the Initial Developer are Copyright (C) 2000-2005
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Ben Goodger <ben@mozilla.org>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-const FILEACTION_SAVE_TO_DISK     = 1;
-const FILEACTION_OPEN_INTERNALLY  = 2;
-const FILEACTION_OPEN_DEFAULT     = 3;
-const FILEACTION_OPEN_CUSTOM      = 4;
-const FILEACTION_OPEN_PLUGIN      = 5;
-function FileAction ()
-{
-}
-FileAction.prototype = {
-  type        : "",
-  extension   : "",
-  hasExtension: true,
-  editable    : true,
-  smallIcon   : "",
-  bigIcon     : "",
-  typeName    : "",
-  action      : "",
-  mimeInfo    : null,
-  customHandler       : "",
-  handleMode          : false,
-  pluginAvailable     : false,
-  pluginEnabled       : false,
-  handledOnlyByPlugin : false
-};
-
-