Bug 1546689 - Remove substitution of Ci.nsIFooBar with nsIFooBar from SeaMonkey preferences. r=frg a=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Wed, 24 Apr 2019 18:54:00 +0200
changeset 32189 33e9c7be67682a74b1558f4fc474f64ad003de7c
parent 32188 a441444f65f14b5a24b71ea2465469e8c2f5e06e
child 32190 7787632227e0da0b59c1ee1a946ce1d048b9199f
push id187
push userfrgrahl@gmx.net
push dateWed, 24 Apr 2019 16:55:18 +0000
treeherdercomm-esr60@33e9c7be6768 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1546689
Bug 1546689 - Remove substitution of Ci.nsIFooBar with nsIFooBar from SeaMonkey preferences. r=frg a=frg
suite/components/pref/content/pref-applicationManager.js
suite/components/pref/content/pref-applications.js
suite/components/pref/content/pref-cache.js
suite/components/pref/content/pref-navigator.js
suite/components/pref/content/preferences.js
--- a/suite/components/pref/content/pref-applicationManager.js
+++ b/suite/components/pref/content/pref-applicationManager.js
@@ -25,17 +25,17 @@ var gAppManagerDialog = {
       contentText = bundle.getFormattedString(key, [description]);
     }
     document.getElementById("appDescription").textContent = contentText;
 
     var list = document.getElementById("appList");
     var apps = this.handlerInfo.possibleApplicationHandlers.enumerate();
     while (apps.hasMoreElements()) {
       let app = apps.getNext();
-      app.QueryInterface(nsIHandlerApp);
+      app.QueryInterface(Ci.nsIHandlerApp);
       var item = list.appendItem(app.name);
       item.className = "listitem-iconic";
       item.setAttribute("image", gApplicationsPane._getIconURLForHandlerApp(app));
       item.app = app;
     }
 
     list.selectedIndex = 0;
   },
@@ -78,21 +78,21 @@ var gAppManagerDialog = {
     var list = document.getElementById("appList");
     if (!list.selectedItem) {
       document.getElementById("cmd_delete").setAttribute("disabled", "true");
       return;
     }
     document.getElementById("cmd_delete").removeAttribute("disabled");
     var app = list.selectedItem.app;
     var address = "";
-    if (app instanceof nsILocalHandlerApp)
+    if (app instanceof Ci.nsILocalHandlerApp)
       address = app.executable.path;
-    else if (app instanceof nsIWebHandlerApp)
+    else if (app instanceof Ci.nsIWebHandlerApp)
       address = app.uriTemplate;
-    else if (app instanceof nsIWebContentHandlerInfo)
+    else if (app instanceof Ci.nsIWebContentHandlerInfo)
       address = app.uri;
     document.getElementById("appLocation").value = address;
     var bundle = document.getElementById("appManagerBundle");
-    var appType = app instanceof nsILocalHandlerApp ? "descriptionLocalApp"
-                                                    : "descriptionWebApp";
+    var appType = app instanceof Ci.nsILocalHandlerApp ? "descriptionLocalApp"
+                                                       : "descriptionWebApp";
     document.getElementById("appType").value = bundle.getString(appType);
   }
 };
--- a/suite/components/pref/content/pref-applications.js
+++ b/suite/components/pref/content/pref-applications.js
@@ -9,26 +9,16 @@ ChromeUtils.import("resource://gre/modul
 function Startup()
 {
   gApplicationsPane.init();
 }
 
 //****************************************************************************//
 // Constants & Enumeration Values
 
-// constants for interfaces we need multiple times
-const nsIHandlerApp = Ci.nsIHandlerApp;
-const nsIHandlerInfo = Ci.nsIHandlerInfo;
-const nsILocalHandlerApp = Ci.nsILocalHandlerApp;
-const nsIWebHandlerApp = Ci.nsIWebHandlerApp;
-const nsIWebContentHandlerInfo = Ci.nsIWebContentHandlerInfo;
-const nsIFilePicker = Ci.nsIFilePicker;
-const nsIMIMEInfo = Ci.nsIMIMEInfo;
-const nsIPropertyBag = Ci.nsIPropertyBag;
-
 // global services
 var handlerSvc = Cc["@mozilla.org/uriloader/handler-service;1"]
                    .getService(Ci.nsIHandlerService);
 var categoryMgr = Cc["@mozilla.org/categorymanager;1"]
                     .getService(Ci.nsICategoryManager);
 var mimeSvc = Cc["@mozilla.org/mime;1"]
                 .getService(Ci.nsIMIMEService);
 var converterSvc = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"]
@@ -111,17 +101,17 @@ function getFileDisplayName(aFile) {
       return aFile.bundleDisplayName;
     } catch (e) {}
   }
   return aFile.leafName;
 }
 
 function getLocalHandlerApp(aFile) {
   var localHandlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
-                          .createInstance(nsILocalHandlerApp);
+                          .createInstance(Ci.nsILocalHandlerApp);
   localHandlerApp.name = getFileDisplayName(aFile);
   localHandlerApp.executable = aFile;
 
   return localHandlerApp;
 }
 
 /**
  * An enumeration of items in a JS array.
@@ -256,21 +246,21 @@ HandlerInfoWrapper.prototype = {
       return kActionUsePlugin;
 
     // If the action is to use a helper app, but we don't have a preferred
     // handler app, then switch to using the system default, if any; otherwise
     // fall back to saving to disk, which is the default action in nsMIMEInfo.
     // Note: "save to disk" is an invalid value for protocol info objects,
     // but the alwaysAskBeforeHandling getter will detect that situation
     // and always return true in that case to override this invalid value.
-    if (this.wrappedHandlerInfo.preferredAction == nsIHandlerInfo.useHelperApp &&
+    if (this.wrappedHandlerInfo.preferredAction == Ci.nsIHandlerInfo.useHelperApp &&
         !gApplicationsPane.isValidHandlerApp(this.preferredApplicationHandler)) {
       return this.wrappedHandlerInfo.hasDefaultHandler ?
-             nsIHandlerInfo.useSystemDefault :
-             nsIHandlerInfo.saveToDisk;
+             Ci.nsIHandlerInfo.useSystemDefault :
+             Ci.nsIHandlerInfo.saveToDisk;
     }
 
     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"
@@ -291,18 +281,18 @@ HandlerInfoWrapper.prototype = {
       return false;
 
     // If this is a protocol type and the preferred action is "save to disk",
     // which is invalid for such types, then return true here to override that
     // action.  This could happen when the preferred action is to use a helper
     // app, but the preferredApplicationHandler is invalid, and there isn't
     // a default handler, so the preferredAction getter returns save to disk
     // instead.
-    if (!(this.wrappedHandlerInfo instanceof nsIMIMEInfo) &&
-        this.preferredAction == nsIHandlerInfo.saveToDisk)
+    if (!(this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) &&
+        this.preferredAction == Ci.nsIHandlerInfo.saveToDisk)
       return true;
 
     return this.wrappedHandlerInfo.alwaysAskBeforeHandling;
   },
 
   set alwaysAskBeforeHandling(aNewValue) {
     this.wrappedHandlerInfo.alwaysAskBeforeHandling = aNewValue;
   },
@@ -313,17 +303,17 @@ HandlerInfoWrapper.prototype = {
 
   // 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 nsIMIMEInfo &&
+      if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
           this.wrappedHandlerInfo.primaryExtension)
         return this.wrappedHandlerInfo.primaryExtension;
     } catch(ex) {}
 
     return null;
   },
 
 
@@ -418,17 +408,17 @@ HandlerInfoWrapper.prototype = {
   get largeIcon() {
     return this._getIcon(32);
   },
 
   _getIcon: function(aSize) {
     if (this.primaryExtension)
       return "moz-icon://goat." + this.primaryExtension + "?size=" + aSize;
 
-    if (this.wrappedHandlerInfo instanceof nsIMIMEInfo)
+    if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo)
       return "moz-icon://goat?size=" + aSize + "&contentType=" + this.type;
 
     // We're falling back to a generic icon when we can't get a URL for one
     // (for example in the case of protocol schemes).
     return null;
   },
 
   // The type class is used for setting icons through CSS for types that don't
@@ -488,21 +478,21 @@ FeedHandlerInfo.prototype = {
         // When the pref is set to messenger, 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 nsILocalHandlerApp) {
+    if (aNewValue instanceof Ci.nsILocalHandlerApp) {
       document.getElementById(this._prefSelectedApp).value = aNewValue.executable;
       document.getElementById(this._prefSelectedReader).value = "client";
     }
-    else if (aNewValue instanceof nsIWebContentHandlerInfo) {
+    else if (aNewValue instanceof Ci.nsIWebContentHandlerInfo) {
       document.getElementById(this._prefSelectedWeb).value = aNewValue.uri;
       document.getElementById(this._prefSelectedReader).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, RSS News & Blogs, 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.
@@ -592,19 +582,19 @@ FeedHandlerInfo.prototype = {
       defaultFeedReader = shellSvc.defaultFeedReader;
     }
     catch(ex) {
       // no default reader
     }
 
     if (defaultFeedReader) {
       let handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
-                         .createInstance(nsIHandlerApp);
+                         .createInstance(Ci.nsIHandlerApp);
       handlerApp.name = getFileDisplayName(defaultFeedReader);
-      handlerApp.QueryInterface(nsILocalHandlerApp);
+      handlerApp.QueryInterface(Ci.nsILocalHandlerApp);
       handlerApp.executable = defaultFeedReader;
 
       this.__defaultApplicationHandler = handlerApp;
     }
     else {
       this.__defaultApplicationHandler = null;
     }
 
@@ -638,52 +628,52 @@ FeedHandlerInfo.prototype = {
       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 nsIHandlerInfo.useSystemDefault;
+            return Ci.nsIHandlerInfo.useSystemDefault;
 
-          return nsIHandlerInfo.useHelperApp;
+          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 nsIHandlerInfo.handleInternally;
+        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":
       case "messenger":
       default:
-        return nsIHandlerInfo.handleInternally;
+        return Ci.nsIHandlerInfo.handleInternally;
     }
   },
 
   set preferredAction(aNewValue) {
     switch (aNewValue) {
 
-      case nsIHandlerInfo.handleInternally:
+      case Ci.nsIHandlerInfo.handleInternally:
         document.getElementById(this._prefSelectedReader).value = "messenger";
         break;
 
-      case nsIHandlerInfo.useHelperApp:
+      case Ci.nsIHandlerInfo.useHelperApp:
         document.getElementById(this._prefSelectedAction).value = "reader";
         // The controller has already set preferredApplicationHandler
         // to the new helper app.
         break;
 
-      case nsIHandlerInfo.useSystemDefault:
+      case Ci.nsIHandlerInfo.useSystemDefault:
         document.getElementById(this._prefSelectedAction).value = "reader";
         this.preferredApplicationHandler = this._defaultApplicationHandler;
         break;
     }
   },
 
   get alwaysAskBeforeHandling() {
     return document.getElementById(this._prefSelectedAction).value == "ask";
@@ -716,27 +706,27 @@ FeedHandlerInfo.prototype = {
 
   // Changes to the preferred action and handler take effect immediately
   // (we write them out to the preferences right as they happen),
   // so we when the controller calls store() after modifying the handlers,
   // the only thing we need to store is the removal of possible handlers
   // XXX Should we hold off on making the changes until this method gets called?
   store: function() {
     for (let app of this._possibleApplicationHandlers._removed) {
-      if (app instanceof nsILocalHandlerApp) {
+      if (app instanceof Ci.nsILocalHandlerApp) {
         let pref = document.getElementById(PREF_FEED_SELECTED_APP);
         var preferredAppFile = pref.value;
         if (preferredAppFile) {
           let preferredApp = getLocalHandlerApp(preferredAppFile);
           if (app.equals(preferredApp))
             pref.reset();
         }
       }
       else {
-        app.QueryInterface(nsIWebContentHandlerInfo);
+        app.QueryInterface(Ci.nsIWebContentHandlerInfo);
         converterSvc.removeContentHandler(app.contentType, app.uri);
       }
     }
     this._possibleApplicationHandlers._removed = [];
   },
 
 
   //**************************************************************************//
@@ -1031,17 +1021,17 @@ var gApplicationsPane = {
 
   /**
    * Load the set of handlers defined by the application datastore.
    */
   _loadApplicationHandlers: function() {
     var wrappedHandlerInfos = handlerSvc.enumerate();
     while (wrappedHandlerInfos.hasMoreElements()) {
       let wrappedHandlerInfo =
-        wrappedHandlerInfos.getNext().QueryInterface(nsIHandlerInfo);
+        wrappedHandlerInfos.getNext().QueryInterface(Ci.nsIHandlerInfo);
       let type = wrappedHandlerInfo.type;
 
       let handlerInfoWrapper;
       if (type in this._handledTypes)
         handlerInfoWrapper = this._handledTypes[type];
       else {
         handlerInfoWrapper = new HandlerInfoWrapper(type, wrappedHandlerInfo);
         this._handledTypes[type] = handlerInfoWrapper;
@@ -1071,17 +1061,17 @@ var gApplicationsPane = {
       // Hide plugins without associated 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, since plugins are
       // only associated with MIME types.
       // FIXME: should we also check the "suffixes" property of the plugin?
       // Filed as bug 395135.
       if (hidePluginsWithoutExtensions && handlerInfo.handledOnlyByPlugin &&
-          handlerInfo.wrappedHandlerInfo instanceof nsIMIMEInfo &&
+          handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
           !handlerInfo.primaryExtension)
         continue;
 
       // Hide types handled only by plugins if so prefed.
       if (handlerInfo.handledOnlyByPlugin && !showPlugins)
         continue;
 
       // We couldn't find any reason to exclude the type, so include it.
@@ -1175,27 +1165,27 @@ var gApplicationsPane = {
       if (isFeedType(aHandlerInfo.type))
         return this._prefsBundle.getFormattedString("previewInApp",
                                                     [this._brandShortName]);
       else
         return this._prefsBundle.getString("alwaysAsk");
     }
 
     switch (aHandlerInfo.preferredAction) {
-      case nsIHandlerInfo.saveToDisk:
+      case Ci.nsIHandlerInfo.saveToDisk:
         return this._prefsBundle.getString("saveFile");
 
-      case nsIHandlerInfo.useHelperApp:
+      case Ci.nsIHandlerInfo.useHelperApp:
         var preferredApp = aHandlerInfo.preferredApplicationHandler;
-        var name = (preferredApp instanceof nsILocalHandlerApp) ?
+        var name = (preferredApp instanceof Ci.nsILocalHandlerApp) ?
                    getFileDisplayName(preferredApp.executable) :
                    preferredApp.name;
         return this._prefsBundle.getFormattedString("useApp", [name]);
 
-      case nsIHandlerInfo.handleInternally:
+      case Ci.nsIHandlerInfo.handleInternally:
         // For the feed type, handleInternally means News & Blogs.
         if (isFeedType(aHandlerInfo.type))
           return this._prefsBundle.getFormattedString("addNewsBlogsInApp",
                                                       [this._brandShortName]);
 
         // For other types, handleInternally looks like either useHelperApp
         // or useSystemDefault depending on whether or not there's a preferred
         // handler app.
@@ -1203,17 +1193,17 @@ var gApplicationsPane = {
                aHandlerInfo.preferredApplicationHandler.name :
                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 nsIHandlerInfo.useSystemDefault:
+      case Ci.nsIHandlerInfo.useSystemDefault:
         return this._prefsBundle.getFormattedString("useDefault",
                                                     [aHandlerInfo.defaultDescription]);
 
       case kActionUsePlugin:
         return this._prefsBundle.getFormattedString("usePluginIn",
                                                     [aHandlerInfo.plugin.name,
                                                      this._brandShortName]);
     }
@@ -1227,23 +1217,23 @@ var gApplicationsPane = {
    * @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 nsILocalHandlerApp)
+    if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
       return this._isValidHandlerExecutable(aHandlerApp.executable);
 
-    if (aHandlerApp instanceof nsIWebHandlerApp)
+    if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
       return aHandlerApp.uriTemplate;
 
-    if (aHandlerApp instanceof nsIWebContentHandlerInfo)
+    if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
       return aHandlerApp.uri;
 
     return false;
   },
 
   _isValidHandlerExecutable: function(aExecutable) {
     var file = Services.dirsvc.get("XREExeF",
                                    Ci.nsIFile);
@@ -1270,50 +1260,50 @@ var gApplicationsPane = {
 
     // Clear out existing items.
     while (menuPopup.hasChildNodes())
       menuPopup.lastChild.remove();
 
     {
       let askMenuItem = document.createElement("menuitem");
       askMenuItem.setAttribute("class", "handler-action");
-      askMenuItem.setAttribute("value", nsIHandlerInfo.alwaysAsk);
+      askMenuItem.setAttribute("value", Ci.nsIHandlerInfo.alwaysAsk);
       let label;
       if (isFeedType(handlerInfo.type))
         label = this._prefsBundle.getFormattedString("previewInApp",
                                                      [this._brandShortName]);
       else
         label = this._prefsBundle.getString("alwaysAsk");
       askMenuItem.setAttribute("label", label);
       askMenuItem.setAttribute("tooltiptext", label);
       askMenuItem.setAttribute("appHandlerIcon", "ask");
       menuPopup.appendChild(askMenuItem);
     }
 
     // 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.
-    if ((handlerInfo.wrappedHandlerInfo instanceof nsIMIMEInfo) &&
+    if ((handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) &&
         !isFeedType(handlerInfo.type)) {
       let saveMenuItem = document.createElement("menuitem");
       saveMenuItem.setAttribute("class", "handler-action");
-      saveMenuItem.setAttribute("value", nsIHandlerInfo.saveToDisk);
+      saveMenuItem.setAttribute("value", Ci.nsIHandlerInfo.saveToDisk);
       let label = this._prefsBundle.getString("saveFile");
       saveMenuItem.setAttribute("label", label);
       saveMenuItem.setAttribute("tooltiptext", label);
       saveMenuItem.setAttribute("appHandlerIcon", "save");
       menuPopup.appendChild(saveMenuItem);
     }
 
     // If this is the feed type, add a News & Blogs item.
     if (isFeedType(handlerInfo.type)) {
       let internalMenuItem = document.createElement("menuitem");
       internalMenuItem.setAttribute("class", "handler-action");
-      internalMenuItem.setAttribute("value", nsIHandlerInfo.handleInternally);
+      internalMenuItem.setAttribute("value", Ci.nsIHandlerInfo.handleInternally);
       let label = this._prefsBundle.getFormattedString("addNewsBlogsInApp",
                                                        [this._brandShortName]);
       internalMenuItem.setAttribute("label", label);
       internalMenuItem.setAttribute("tooltiptext", label);
       internalMenuItem.setAttribute("appHandlerIcon", "feed");
       menuPopup.appendChild(internalMenuItem);
     }
 
@@ -1321,17 +1311,17 @@ var gApplicationsPane = {
     // that follow them.
     let menuSeparator = document.createElement("menuseparator");
     menuPopup.appendChild(menuSeparator);
 
     // Create a menu item for the OS default application, if any.
     if (handlerInfo.hasDefaultHandler) {
       let defaultMenuItem = document.createElement("menuitem");
       defaultMenuItem.setAttribute("class", "handler-action");
-      defaultMenuItem.setAttribute("value", nsIHandlerInfo.useSystemDefault);
+      defaultMenuItem.setAttribute("value", Ci.nsIHandlerInfo.useSystemDefault);
       let label = this._prefsBundle.getFormattedString("useDefault",
                                                        [handlerInfo.defaultDescription]);
       defaultMenuItem.setAttribute("label", label);
       defaultMenuItem.setAttribute("tooltiptext", handlerInfo.defaultDescription);
       let sysIcon = this._getIconURLForSystemDefault(handlerInfo);
       if (sysIcon)
         defaultMenuItem.setAttribute("image", sysIcon);
       else
@@ -1346,19 +1336,19 @@ var gApplicationsPane = {
     var possibleAppMenuItems = [];
     while (possibleApps.hasMoreElements()) {
       let possibleApp = possibleApps.getNext();
       if (!this.isValidHandlerApp(possibleApp))
         continue;
 
       let menuItem = document.createElement("menuitem");
       menuItem.setAttribute("class", "handler-action");
-      menuItem.setAttribute("value", nsIHandlerInfo.useHelperApp);
+      menuItem.setAttribute("value", Ci.nsIHandlerInfo.useHelperApp);
       let label;
-      if (possibleApp instanceof nsILocalHandlerApp)
+      if (possibleApp instanceof Ci.nsILocalHandlerApp)
         label = getFileDisplayName(possibleApp.executable);
       else
         label = possibleApp.name;
       label = this._prefsBundle.getFormattedString("useApp", [label]);
       menuItem.setAttribute("label", label);
       menuItem.setAttribute("tooltiptext", label);
       let sysIcon = this._getIconURLForHandlerApp(possibleApp);
       if (sysIcon)
@@ -1416,18 +1406,18 @@ var gApplicationsPane = {
       menuPopup.appendChild(menuItem);
     }
 
     // Select the item corresponding to the preferred action.  If the always
     // ask flag is set, it overrides the preferred action.  Otherwise we pick
     // the item identified by the preferred action (when the preferred action
     // is to use a helper app, we have to pick the specific helper app item).
     if (handlerInfo.alwaysAskBeforeHandling)
-      menu.value = nsIHandlerInfo.alwaysAsk;
-    else if (handlerInfo.preferredAction == nsIHandlerInfo.useHelperApp &&
+      menu.value = Ci.nsIHandlerInfo.alwaysAsk;
+    else if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.useHelperApp &&
              preferredApp)
       menu.selectedItem =
         possibleAppMenuItems.filter(v => v.handlerApp.equals(preferredApp))[0];
     else
       menu.value = handlerInfo.preferredAction;
   },
 
 
@@ -1516,24 +1506,24 @@ var gApplicationsPane = {
       handlerInfo.disablePluginType();
 
     // Set the preferred application handler.
     // We leave 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 choose to handle the type.
-    if (action == nsIHandlerInfo.useHelperApp)
+    if (action == Ci.nsIHandlerInfo.useHelperApp)
       handlerInfo.preferredApplicationHandler = aActionItem.handlerApp;
 
     // Set the preferred action.
     handlerInfo.preferredAction = action;
 
     // Set the "always ask" flag.
-    handlerInfo.alwaysAskBeforeHandling = action == nsIHandlerInfo.alwaysAsk;
+    handlerInfo.alwaysAskBeforeHandling = action == Ci.nsIHandlerInfo.alwaysAsk;
 
     handlerInfo.store();
 
     // Make sure the handler info object is flagged to indicate that there is
     // now some user configuration for the type.
     handlerInfo.handledOnlyByPlugin = false;
 
     // Update the action label and image to reflect the new preferred action.
@@ -1622,27 +1612,26 @@ var gApplicationsPane = {
       if (this.isValidHandlerApp(params.handlerApp)) {
         handlerApp = params.handlerApp;
 
         // Add the app to the type's list of possible handlers.
         handlerInfo.addPossibleApplicationHandler(handlerApp);
       }
       onSelectionDone();
     } else {
-      const nsIFilePicker = Ci.nsIFilePicker;
       let fp = Cc["@mozilla.org/filepicker;1"]
-                 .createInstance(nsIFilePicker);
+                 .createInstance(Ci.nsIFilePicker);
       let winTitle = this._prefsBundle.getString("fpTitleChooseApp");
-      fp.init(window, winTitle, nsIFilePicker.modeOpen);
-      fp.appendFilters(nsIFilePicker.filterApps);
+      fp.init(window, winTitle, Ci.nsIFilePicker.modeOpen);
+      fp.appendFilters(Ci.nsIFilePicker.filterApps);
 
       // Prompt the user to pick an app.  If they pick one, and it's a valid
       // selection, then add it to the list of possible handlers.
       fp.open(rv => {
-        if (rv == nsIFilePicker.returnOK && fp.file &&
+        if (rv == Ci.nsIFilePicker.returnOK && fp.file &&
             this._isValidHandlerExecutable(fp.file)) {
           handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
                          .createInstance(Ci.nsILocalHandlerApp);
           handlerApp.name = getFileDisplayName(fp.file);
           handlerApp.executable = fp.file;
 
           // Add the app to the type's list of possible handlers.
           let handlerInfo = this._handledTypes[this._list.selectedItem.type];
@@ -1660,60 +1649,60 @@ var gApplicationsPane = {
     aElement.removeAttribute("actionIcon");
 
     if (aHandlerInfo.alwaysAskBeforeHandling) {
       aElement.setAttribute("appHandlerIcon", "ask");
       return true;
     }
 
     switch (aHandlerInfo.preferredAction) {
-      case nsIHandlerInfo.saveToDisk:
+      case Ci.nsIHandlerInfo.saveToDisk:
         aElement.setAttribute("appHandlerIcon", "save");
         return true;
 
-      case nsIHandlerInfo.handleInternally:
+      case Ci.nsIHandlerInfo.handleInternally:
         if (isFeedType(aHandlerInfo.type)) {
           aElement.setAttribute("appHandlerIcon", "feed");
           return true;
         }
         break;
 
       case kActionUsePlugin:
         aElement.setAttribute("appHandlerIcon", "plugin");
         return true;
     }
     aElement.removeAttribute("appHandlerIcon");
     return false;
   },
 
   _getIconURLForPreferredAction: function(aHandlerInfo) {
     switch (aHandlerInfo.preferredAction) {
-      case nsIHandlerInfo.useSystemDefault:
+      case Ci.nsIHandlerInfo.useSystemDefault:
         return this._getIconURLForSystemDefault(aHandlerInfo);
 
-      case nsIHandlerInfo.useHelperApp:
+      case Ci.nsIHandlerInfo.useHelperApp:
         let preferredApp = aHandlerInfo.preferredApplicationHandler;
         if (this.isValidHandlerApp(preferredApp))
           return this._getIconURLForHandlerApp(preferredApp);
         break;
     }
     // This should never happen, but if preferredAction is set to some weird
     // value, then fall back to the generic application icon.
     return null;
   },
 
   _getIconURLForHandlerApp: function(aHandlerApp) {
-    if (aHandlerApp instanceof nsILocalHandlerApp)
+    if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
       return this._getIconURLForFile(aHandlerApp.executable);
 
     if (Services.prefs.getBoolPref("browser.chrome.favicons")) { // q.v. Bug 514671
-      if (aHandlerApp instanceof nsIWebHandlerApp)
+      if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
         return this._getIconURLForWebApp(aHandlerApp.uriTemplate);
 
-      if (aHandlerApp instanceof nsIWebContentHandlerInfo)
+      if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
         return this._getIconURLForWebApp(aHandlerApp.uri)
     }
 
     // We know nothing about other kinds of handler apps.
     return "";
   },
 
   _getIconURLForFile: function(aFile) {
@@ -1737,18 +1726,18 @@ var gApplicationsPane = {
 
   _getIconURLForSystemDefault: function(aHandlerInfo) {
     // Handler info objects for MIME types on some OSes implement a property bag
     // interface from which we can get an icon for the default app, so if we're
     // dealing with a MIME type on one of those OSes, then try to get the icon.
     if ("wrappedHandlerInfo" in aHandlerInfo) {
       let wrappedHandlerInfo = aHandlerInfo.wrappedHandlerInfo;
 
-      if (wrappedHandlerInfo instanceof nsIMIMEInfo &&
-          wrappedHandlerInfo instanceof nsIPropertyBag) {
+      if (wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
+          wrappedHandlerInfo instanceof Ci.nsIPropertyBag) {
         try {
           let url = wrappedHandlerInfo.getProperty("defaultApplicationIconURL");
           if (url)
             return url + "?size=16";
         }
         catch(ex) {}
       }
     }
--- a/suite/components/pref/content/pref-cache.js
+++ b/suite/components/pref/content/pref-cache.js
@@ -60,29 +60,28 @@ function ReadCacheFolder(aField)
   if (file) {
     aField.file = file;
     aField.label = (/Mac/.test(navigator.platform)) ? file.leafName : file.path;
   }
 }
 
 function CacheSelectFolder()
 {
-  const nsIFilePicker = Ci.nsIFilePicker;
   let fp = Cc["@mozilla.org/filepicker;1"]
-             .createInstance(nsIFilePicker);
+             .createInstance(Ci.nsIFilePicker);
   let title = document.getElementById("bundle_prefutilities")
                       .getString("cachefolder");
 
-  fp.init(window, title, nsIFilePicker.modeGetFolder);
+  fp.init(window, title, Ci.nsIFilePicker.modeGetFolder);
   fp.displayDirectory = 
     document.getElementById("browser.cache.disk.parent_directory").value;
-  fp.appendFilters(nsIFilePicker.filterAll);
+  fp.appendFilters(Ci.nsIFilePicker.filterAll);
 
   fp.open(rv => {
-    if (rv != nsIFilePicker.returnOK || !fp.file) {
+    if (rv != Ci.nsIFilePicker.returnOK || !fp.file) {
       return;
     }
     document.getElementById("browser.cache.disk.parent_directory").value = fp.file;
   });
 }
 
 function ClearDiskAndMemCache()
 {
--- a/suite/components/pref/content/pref-navigator.js
+++ b/suite/components/pref/content/pref-navigator.js
@@ -197,30 +197,29 @@ function UpdateHomePageList(aSingleURL)
 {
   // write single URL into input box and set it as the list of homepages
   SetHomePageValue(aSingleURL);
   UpdateHomePageListFromInput();
 }
 
 function SelectFile()
 {
-  const nsIFilePicker = Ci.nsIFilePicker;
   let fp = Cc["@mozilla.org/filepicker;1"]
-             .createInstance(nsIFilePicker);
+             .createInstance(Ci.nsIFilePicker);
   let title = document.getElementById("bundle_prefutilities")
                       .getString("choosehomepage");
-  fp.init(window, title, nsIFilePicker.modeOpen);
-  fp.appendFilters(nsIFilePicker.filterAll  |
-                   nsIFilePicker.filterText |
-                   nsIFilePicker.filterXML  |
-                   nsIFilePicker.filterHTML |
-                   nsIFilePicker.filterImages);
+  fp.init(window, title, Ci.nsIFilePicker.modeOpen);
+  fp.appendFilters(Ci.nsIFilePicker.filterAll  |
+                   Ci.nsIFilePicker.filterText |
+                   Ci.nsIFilePicker.filterXML  |
+                   Ci.nsIFilePicker.filterHTML |
+                   Ci.nsIFilePicker.filterImages);
 
   fp.open(rv => {
-    if (rv == nsIFilePicker.returnOK && fp.fileURL.spec && 
+    if (rv == Ci.nsIFilePicker.returnOK && fp.fileURL.spec &&
         fp.fileURL.spec.length > 0) {
       UpdateHomePageList(fp.fileURL.spec);
     }
   });
 }
 
 function SetHomePageToCurrentPage()
 {
--- a/suite/components/pref/content/preferences.js
+++ b/suite/components/pref/content/preferences.js
@@ -54,36 +54,35 @@ function WriteSoundField(aField, aValue)
     aField.file = file;
     aField.label = (AppConstants.platform == "macosx") ? file.leafName : file.path;
   }
 }
 
 function SelectSound(aSoundUrlPref)
 {
   var soundUrlPref = aSoundUrlPref;
-  const nsIFilePicker = Ci.nsIFilePicker;
   let fp = Cc["@mozilla.org/filepicker;1"]
-             .createInstance(nsIFilePicker);
+             .createInstance(Ci.nsIFilePicker);
   var prefutilitiesBundle = document.getElementById("bundle_prefutilities");
   fp.init(window, prefutilitiesBundle.getString("choosesound"),
-          nsIFilePicker.modeOpen);
+          Ci.nsIFilePicker.modeOpen);
 
   let file = GetFileFromString(soundUrlPref.value);
   if (file && file.parent && file.parent.exists())
     fp.displayDirectory = file.parent;
 
   let filterExts = "*.wav; *.wave";
   // On Mac, allow AIFF and CAF files too.
   if (AppConstants.platform == "macosx") {
     filterExts += "; *.aif; *.aiff; *.caf";
   }
   fp.appendFilter(prefutilitiesBundle.getString("SoundFiles"), filterExts);
-  fp.appendFilters(nsIFilePicker.filterAll);
+  fp.appendFilters(Ci.nsIFilePicker.filterAll);
   fp.open(rv => {
-    if (rv == nsIFilePicker.returnOK && fp.fileURL.spec && 
+    if (rv == Ci.nsIFilePicker.returnOK && fp.fileURL.spec &&
         fp.fileURL.spec.length > 0) {
       soundUrlPref.value = fp.fileURL.spec;
     }
   });
 }
 
 function PlaySound(aValue, aMail)
 {