Bug 1436605 - Replace remaining Components.interface/Components.utils uses with Ci/Cu in mail, chat, common and mailnews. r=jorgk a=jorgk
authoraceman <acelists@atlas.sk>
Mon, 12 Mar 2018 16:32:00 +0100
changeset 31299 ebb2e9fc3e3579b8854b50f87c249b8479ab7c15
parent 31298 caa39736adf8e8e54c02962e45b112741640d3a8
child 31300 653f2039952a976cdda8500d8b69a81cbefc3e98
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersjorgk, jorgk
bugs1436605
Bug 1436605 - Replace remaining Components.interface/Components.utils uses with Ci/Cu in mail, chat, common and mailnews. r=jorgk a=jorgk
chat/content/convbrowser.xml
common/bindings/preferences.xml
mail/base/content/mailWidgets.xml
mail/base/content/mailWindowOverlay.xul
mail/base/content/search.xml
mail/base/content/tabmail.xml
mail/components/cloudfile/nsIMsgCloudFileProvider.idl
mail/components/compose/content/MsgComposeCommands.js
mail/components/newmailaccount/content/uriListener.js
mail/test/mozmill/shared-modules/test-mock-object-helpers.js
mail/test/resources/jsbridge/jsbridge/__init__.py
mail/test/resources/mozmill/mozmill/extension/content/rec.js
mail/test/resources/mozmill/patches/eventUtils.patch
mailnews/addrbook/content/abDragDrop.js
mailnews/base/search/content/FilterEditor.js
mailnews/db/gloda/content/glodacomplete.xml
mailnews/db/gloda/modules/index_msg.js
mailnews/db/gloda/modules/log4moz.js
--- a/chat/content/convbrowser.xml
+++ b/chat/content/convbrowser.xml
@@ -95,17 +95,17 @@
             return owner.frameLoader.messageManager;
           ]]>
         </getter>
       </property>
 
       <field name="_webNavigation">null</field>
 
       <property name="webNavigation"
-                onget="return this._webNavigation || (this._webNavigation = this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation));"
+                onget="return this._webNavigation || (this._webNavigation = this.docShell.QueryInterface(Ci.nsIWebNavigation));"
                 readonly="true"/>
 
       <field name="_finder">null</field>
 
       <property name="finder" readonly="true">
         <getter><![CDATA[
           if (!this._finder) {
             if (!this.docShell)
@@ -139,23 +139,23 @@
         </getter>
       </property>
 
       <field name="_lastSearchString">null</field>
       <field name="_lastSearchHighlight">false</field>
 
       <property name="webProgress"
                 readonly="true"
-                onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);"/>
+                onget="return this.docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebProgress);"/>
 
       <field name="_contentWindow">null</field>
 
       <property name="contentWindow"
                 readonly="true"
-                onget="return this._contentWindow || (this._contentWindow = this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow));"/>
+                onget="return this._contentWindow || (this._contentWindow = this.docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow));"/>
 
       <property name="contentWindowAsCPOW"
                 readonly="true"
                 onget="return this.contentWindow;"/>
 
       <property name="contentDocument"
                 onget="return this.webNavigation.document;"
                 readonly="true"/>
@@ -1298,20 +1298,20 @@
             Cc["@mozilla.org/uriloader/external-protocol-service;1"]
               .getService(Ci.nsIExternalProtocolService)
               .loadURI(uri);
           }
         ]]>
       </handler>
 
       <handler event="keypress" modifiers="shift" keycode="VK_PAGE_UP"
-               action="this.docShell.QueryInterface(Components.interfaces.nsITextScroll).scrollByPages(-1);"/>
+               action="this.docShell.QueryInterface(Ci.nsITextScroll).scrollByPages(-1);"/>
 
       <handler event="keypress" modifiers="shift" keycode="VK_PAGE_DOWN"
-               action="this.docShell.QueryInterface(Components.interfaces.nsITextScroll).scrollByPages(1);"/>
+               action="this.docShell.QueryInterface(Ci.nsITextScroll).scrollByPages(1);"/>
 
       <handler event="keypress" modifiers="alt" keycode="VK_PAGE_UP"
                action="this.scrollToPreviousSection();"/>
 
       <handler event="keypress" modifiers="alt" keycode="VK_PAGE_DOWN"
                action="this.scrollToNextSection();"/>
 
       <handler event="keypress" keycode="VK_HOME"
--- a/common/bindings/preferences.xml
+++ b/common/bindings/preferences.xml
@@ -77,29 +77,26 @@
           } catch (e) {
             Cu.reportError(e);
           }
         ]]>
         </body>
       </method>
 
       <field name="service">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefService);
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService);
       </field>
       <field name="rootBranch">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefBranch);
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
       </field>
       <field name="defaultBranch">
         this.service.getDefaultBranch("");
       </field>
       <field name="rootBranchInternal">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefBranch);
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
       </field>
       <property name="type" readonly="true">
         <getter>
           <![CDATA[
             return document.documentElement.type || "";
           ]]>
         </getter>
       </property>
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -1672,17 +1672,17 @@
       </constructor>
     </implementation>
   </binding>
 
   <!-- searchoperator - Contains, Is Less than, etc -->
   <binding id="searchoperator" name="searchOperator"
            extends="chrome://messenger/content/mailWidgets.xml#search-menulist-abstract">
     <implementation>
-      <field name="searchAttribute">Components.interfaces.nsMsgSearchAttrib.Default</field>
+      <field name="searchAttribute">Ci.nsMsgSearchAttrib.Default</field>
       <field name="stringBundle">
         <![CDATA[
           this.Services.strings.createBundle("chrome://messenger/locale/search-operators.properties")
         ]]>
       </field>
       <property name="valueLabel" readonly="true">
         <getter>
           <![CDATA[
--- a/mail/base/content/mailWindowOverlay.xul
+++ b/mail/base/content/mailWindowOverlay.xul
@@ -2276,19 +2276,19 @@
               observes="cmd_createFilterFromPopup"/>
   </menupopup>
 
   <menupopup id="copyPopup">
     <menuitem id="copyMenuitem"
               label="&copyCmd.label;"
               accesskey="&copyCmd.accesskey;"
               tooltiptext="&copyCmd.label;"
-              oncommand="Components.classes['@mozilla.org/widget/clipboardhelper;1']
-                         .getService(Components.interfaces.nsIClipboardHelper)
-                         .copyString(window.getSelection().isCollapsed ?
+              oncommand="Cc['@mozilla.org/widget/clipboardhelper;1']
+                           .getService(Ci.nsIClipboardHelper)
+                           .copyString(window.getSelection().isCollapsed ?
                              document.popupNode.textContent :
                              window.getSelection().toString());"/>
     <menuitem id="createFilterFromMenuItem" label="&CreateFilterFrom.label;"
               accesskey="&CreateFilterFrom.accesskey;"
               oncommand="CreateFilter(this.parentNode.triggerNode.parentNode, gMessageDisplay.displayedMessage)"
               observes="cmd_createFilterFromPopup"/>
   </menupopup>
 
--- a/mail/base/content/search.xml
+++ b/mail/base/content/search.xml
@@ -63,17 +63,17 @@
                                  (AppConstants.platform == "macosx") ?
                                   "keyLabelMac" : "keyLabelNonMac")));
 
           Services.prefs.addObserver("mailnews.database.global.indexer.enabled",
                                      this._prefObserver);
 
           this.glodaCompleter =
             Cc["@mozilla.org/autocomplete/search;1?name=gloda"]
-              .getService()
+              .getService(Ci.nsIAutoCompleteSearch)
               .wrappedJSObject;
           Services.obs.addObserver(this, "autocomplete-did-enter-text");
 
           this.glodaEnabled =
             Services.prefs.getBoolPref("mailnews.database.global.indexer.enabled");
           this.collapsed = !this.glodaEnabled;
 
           // make sure we set our emptytext here from the get-go
@@ -96,34 +96,33 @@
 
       <field name="_prefObserver">({
         inputSearch: this,
         observe: function(subject, topic, data)
         {
           ChromeUtils.import("resource://gre/modules/Services.jsm");
 
           if (topic == "nsPref:changed") {
-            subject.QueryInterface(Components.interfaces.nsIPrefBranch);
+            subject.QueryInterface(Ci.nsIPrefBranch);
             switch (data) {
             case "mailnews.database.global.indexer.enabled":
               this.inputSearch.glodaEnabled =
                 Services.prefs.getBoolPref(
                   "mailnews.database.global.indexer.enabled");
               this.inputSearch.collapsed = !this.inputSearch.glodaEnabled;
               break;
             }
           }
         },
 
         QueryInterface: function(aIID)
         {
-          if (aIID.equals(Components.interfaces.nsIObserver) ||
-              aIID.equals(Components.interfaces.nsISupports))
+          if (aIID.equals(Ci.nsIObserver) || aIID.equals(Ci.nsISupports))
             return this;
-          throw Components.results.NS_NOINTERFACE;
+          throw Cr.NS_NOINTERFACE;
         }
         });
       </field>
       <field name="glodaCompleter">null</field>
       <property name="menupopup" readonly="true">
         <getter><![CDATA[
           return document.getAnonymousElementByAttribute(
                    this, 'anonid', 'quick-search-menupopup');
--- a/mail/base/content/tabmail.xml
+++ b/mail/base/content/tabmail.xml
@@ -1803,49 +1803,49 @@
       <field name="mToolbar">
         document.getElementById(this.getAttribute("tabtoolbar"));
       </field>
 
       <field name="mCollapseToolbar">
         document.getElementById(this.getAttribute("collapsetoolbar"));
       </field>
 
-     <field name="_prefObserver">({
+      <field name="_prefObserver"><![CDATA[
+        ({
         tabbox: this,
 
         observe: function(subject, topic, data)
         {
           if (topic == "nsPref:changed") {
-            subject.QueryInterface(Components.interfaces.nsIPrefBranch);
+            subject.QueryInterface(Ci.nsIPrefBranch);
             switch (data) {
             case "mail.tabs.closeButtons":
               this.tabbox.mCloseButtons = subject.getIntPref("mail.tabs.closeButtons");
               this.tabbox._updateCloseButtons();
               break;
             case "mail.tabs.autoHide":
               this.tabbox.mAutoHide = subject.getBoolPref("mail.tabs.autoHide");
               break;
             }
           }
         },
 
         QueryInterface: function(aIID)
         {
-          if (aIID.equals(Components.interfaces.nsIObserver) ||
-              aIID.equals(Components.interfaces.nsISupports))
+          if (aIID.equals(Ci.nsIObserver) || aIID.equals(Ci.nsISupports))
             return this;
-          throw Components.results.NS_NOINTERFACE;
+          throw Cr.NS_NOINTERFACE;
         }
         });
+        ]]>
       </field>
 
       <field name="_tabDropIndicator">
-        document.getAnonymousElementByAttribute(
-            this,
-            "anonid", "tab-drop-indicator");
+        document.getAnonymousElementByAttribute(this, "anonid",
+                                                "tab-drop-indicator");
       </field>
 
       <field name="_dragOverDelay">350</field>
       <field name="_dragTime">0</field>
 
       <field name="mTabMinWidth">100</field>
       <field name="mTabMaxWidth">250</field>
       <field name="mTabClipWidth">140</field>
--- a/mail/components/cloudfile/nsIMsgCloudFileProvider.idl
+++ b/mail/components/cloudfile/nsIMsgCloudFileProvider.idl
@@ -77,17 +77,17 @@ interface nsIMsgCloudFileProvider : nsIS
    * process of creating one. There will probably have to be some sort of
    * validation on the part of the user before the account is created.
    * If not, this will throw NS_ERROR_NOT_IMPLEMENTED.
    *
    * If the REST call succeeds, aCallback.onStopRequest will get called back
    * with an http status. Generally, status between 200 and 300 is OK,
    * otherwise, an error occurred which is * probably specific to the provider.
    * If the request fails completely, onStopRequest will get called with
-   * Components.results.NS_ERROR_FAILURE
+   * Cr.NS_ERROR_FAILURE
    * @throws nsIMsgCloudFileProvider.offlineErr if we are offline.
    */
   void createNewAccount(in ACString aEmailAddress, in ACString aPassword,
                         in ACString aFirstName, in ACString aLastName,
                         in nsIRequestObserver aCallback);
 
   void createExistingAccount(in nsIRequestObserver aCallback);
 
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -5496,17 +5496,17 @@ nsAttachmentOpener.prototype =
   doContent: function(contentType, isContentPreferred, request, contentHandler)
   {
     // If we came here to display an attached message, make sure we provide a type.
     if (/[?&]part=/i.test(request.URI.query)) {
       let newQuery = request.URI.query + "&type=message/rfc822";
       request.URI = request.URI.mutate().setQuery(newQuery).finalize();
     }
     let newHandler = Cc["@mozilla.org/uriloader/content-handler;1?type=application/x-message-display"]
-                       .createInstance(Components.interfaces.nsIContentHandler);
+                       .createInstance(Ci.nsIContentHandler);
     newHandler.handleContent("application/x-message-display", this, request);
     return true;
   },
 
   isPreferred: function(contentType, desiredContentType)
   {
     if (contentType == "message/rfc822")
       return true;
--- a/mail/components/newmailaccount/content/uriListener.js
+++ b/mail/components/newmailaccount/content/uriListener.js
@@ -35,18 +35,18 @@ function httpRequestObserver(aBrowser, a
 
 httpRequestObserver.prototype = {
   observe: function(aSubject, aTopic, aData) {
     if (aTopic != "http-on-examine-response" &&
         aTopic != "http-on-examine-cached-response")
       return;
 
     if (!(aSubject instanceof Ci.nsIHttpChannel)) {
-      Component.utils.reportError("Failed to get a nsIHttpChannel when "
-                                  + "observing http-on-examine-response");
+      Cu.reportError("Failed to get a nsIHttpChannel when "
+                     + "observing http-on-examine-response");
       return;
     }
 
     let contentType = "";
     try {
       contentType = aSubject.getResponseHeader("Content-Type");
     } catch(e) {
       // If we couldn't get the response header, which can happen,
--- a/mail/test/mozmill/shared-modules/test-mock-object-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-mock-object-helpers.js
@@ -53,17 +53,17 @@ MockObjectRegisterer.prototype = {
  *        The ContractID of the component to replace, for example
  *        "@mozilla.org/filepicker;1".
  *
  * @param aReplacementCtor
  *        The constructor function for the JavaScript object that will be
  *        created every time createInstance is called. This object must
  *        implement QueryInterface and provide the XPCOM interfaces required by
  *        the specified ContractID (for example
- *        Components.interfaces.nsIFilePicker).
+ *        Ci.nsIFilePicker).
  */
 
 function MockObjectReplacer(aContractID, aReplacementCtor) {
   this._contractID = aContractID;
   this._replacementCtor = aReplacementCtor;
 }
 
 MockObjectReplacer.prototype = {
--- a/mail/test/resources/jsbridge/jsbridge/__init__.py
+++ b/mail/test/resources/jsbridge/jsbridge/__init__.py
@@ -47,17 +47,17 @@ from jsobjects import JSObject
 
 import mozrunner
 
 settings_env = 'JSBRIDGE_SETTINGS_FILE'
 
 parent = os.path.abspath(os.path.dirname(__file__))
 extension_path = os.path.join(parent, 'extension')
 
-window_string = "Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('')"
+window_string = "Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator).getMostRecentWindow('')"
 
 wait_to_create_timeout = 60
 
 def wait_and_create_network(host, port, timeout=wait_to_create_timeout):
     ttl = 0
     while ttl < timeout:
         try:
             s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -171,16 +171,9 @@ class CLI(mozrunner.CLI):
         port = int(self.options.port)
         host = '127.0.0.1'
         self.back_channel, self.bridge = wait_and_create_network(host, port, timeout)
 
 def cli():
     CLI().run()
 
 def getBrowserWindow(bridge):
-    return JSObject(bridge, "Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('')")
-    
-
-
-
-
-
-
+    return JSObject(bridge, "Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator).getMostRecentWindow('')")
--- a/mail/test/resources/mozmill/mozmill/extension/content/rec.js
+++ b/mail/test/resources/mozmill/mozmill/extension/content/rec.js
@@ -277,18 +277,17 @@ RecorderConnector.prototype.on = functio
   }
 
   var mmWindows = utils.getWindows('navigator:browser');
   if (mmWindows.length != 0){
     mmWindows[0].focus();
   }
 
   var observerService =
-    Components.classes["@mozilla.org/observer-service;1"]
-      .getService(Components.interfaces.nsIObserverService);
+    Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
 
   //Attach the new window open listener
   observerService.addObserver(this.observer, "toplevel-window-ready", false);
 
   currentRecorderArray = [];
 };
 
 RecorderConnector.prototype.off = function() {
@@ -304,18 +303,17 @@ RecorderConnector.prototype.off = functi
     this.unbindListeners(win);
   }
   var r = getRecordedScript(currentRecorderArray);
 
   editor.setContent(r);
   currentRecorderArray = [];
   //remove new window listener
   var observerService =
-    Components.classes["@mozilla.org/observer-service;1"]
-      .getService(Components.interfaces.nsIObserverService);
+    Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
   try { observerService.removeObserver(this.observer, "toplevel-window-ready"); }
   catch(err){}
 };
 
 var MozMillrec = new RecorderConnector();
 
 // Scoping bug workarounds
 var enableRec = function () {
deleted file mode 100644
--- a/mail/test/resources/mozmill/patches/eventUtils.patch
+++ /dev/null
@@ -1,218 +0,0 @@
-diff --git a/mozmill/mozmill/extension/resource/stdlib/EventUtils.js b/mozmill/mozmill/extension/resource/stdlib/EventUtils.js
-index 27fbbc7..0329d47 100644
---- a/mozmill/mozmill/extension/resource/stdlib/EventUtils.js
-+++ b/mozmill/mozmill/extension/resource/stdlib/EventUtils.js
-@@ -1,3 +1,24 @@
-+// Export all available functions for Mozmill
-+var EXPORTED_SYMBOLS = ["sendMouseEvent", "sendChar", "sendString", "sendKey",
-+                         "__doEventDispatch", "_parseModifiers", "synthesizeMouse",
-+                         "synthesizeMouseScroll", "synthesizeKey", "_expectEvent",
-+                         "_checkExpectedEvent", "synthesizeMouseExpectEvent",
-+                         "synthesizeDragStart", "synthesizeDrop",
-+                         "disableNonTestMouseEvents", "_getDOMWindowUtils",
-+                         "synthesizeComposition", "synthesizeText",
-+                         "synthesizeQuerySelectedText", "synthesizeQueryTextContent",
-+                         "synthesizeQueryCaretRect", "synthesizeQueryTextRect",
-+                         "synthesizeQueryEditorRect", "synthesizeCharAtPoint",
-+                         "synthesizeSelectionSet"];
-+
-+/**
-+ * Get the array with available key events
-+ */
-+function getKeyEvent(aWindow) {
-+  var win = aWindow.wrappedJSObject ? aWindow.wrappedJSObject : aWindow;
-+  return win.KeyEvent;
-+}
-+
- /**
-  * EventUtils provides some utility methods for creating and sending DOM events.
-  * Current methods:
-@@ -29,9 +50,6 @@ function sendMouseEvent(aEvent, aTarget, aWindow) {
-     aTarget = aWindow.document.getElementById(aTarget);
-   }
- 
--  // For events to trigger the UA's default actions they need to be "trusted"
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
--
-   var event = aWindow.document.createEvent('MouseEvent');
- 
-   var typeArg          = aEvent.type;
-@@ -107,14 +125,17 @@ function sendString(aStr, aTarget) {
-  * Returns true if the keypress event was accepted (no calls to preventDefault
-  * or anything like that), false otherwise.
-  */
--function sendKey(aKey, aTarget) {
-+function sendKey(aKey, aTarget, aWindow) {
-+  if (!aWindow)
-+    aWindow = window;
-+
-   keyName = "DOM_VK_" + aKey.toUpperCase();
- 
--  if (!KeyEvent[keyName]) {
-+  if (!getKeyEvent(aWindow)[keyName]) {
-     throw "Unknown key: " + keyName;
-   }
- 
--  return __doEventDispatch(aTarget, 0, KeyEvent[keyName], false);
-+  return __doEventDispatch(aTarget, 0, getKeyEvent(aWindow)[keyName], false);
- }
- 
- /**
-@@ -130,9 +151,6 @@ function __doEventDispatch(aTarget, aCharCode, aKeyCode, aHasShift) {
-     aTarget = "target";
-   }
- 
--  // Make our events trusted
--  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
--
-   var event = document.createEvent("KeyEvents");
-   event.initKeyEvent("keydown", true, true, document.defaultView,
-                      false, false, aHasShift, false,
-@@ -171,6 +189,10 @@ function __doEventDispatch(aTarget, aCharCode, aKeyCode, aHasShift) {
-  */
- function _parseModifiers(aEvent)
- {
-+  var hwindow = Components.classes["@mozilla.org/appshell/appShellService;1"]
-+                          .getService(Components.interfaces.nsIAppShellService)
-+                          .hiddenDOMWindow;
-+
-   const masks = Components.interfaces.nsIDOMNSEvent;
-   var mval = 0;
-   if (aEvent.shiftKey)
-@@ -182,8 +204,8 @@ function _parseModifiers(aEvent)
-   if (aEvent.metaKey)
-     mval |= masks.META_MASK;
-   if (aEvent.accelKey)
--    mval |= (navigator.platform.indexOf("Mac") >= 0) ? masks.META_MASK :
--                                                       masks.CONTROL_MASK;
-+    mval |= (hwindow.navigator.platform.indexOf("Mac") >= 0) ? masks.META_MASK :
-+                                                               masks.CONTROL_MASK;
- 
-   return mval;
- }
-@@ -203,8 +225,6 @@ function _parseModifiers(aEvent)
-  */
- function synthesizeMouse(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   if (!aWindow)
-     aWindow = window;
- 
-@@ -253,8 +273,6 @@ function synthesizeMouse(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
-  */
- function synthesizeMouseScroll(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   if (!aWindow)
-     aWindow = window;
- 
-@@ -302,8 +320,6 @@ function synthesizeMouseScroll(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
-  */
- function synthesizeKey(aKey, aEvent, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   if (!aWindow)
-     aWindow = window;
- 
-@@ -312,7 +328,7 @@ function synthesizeKey(aKey, aEvent, aWindow)
-   if (utils) {
-     var keyCode = 0, charCode = 0;
-     if (aKey.indexOf("VK_") == 0)
--      keyCode = KeyEvent["DOM_" + aKey];
-+      keyCode = getKeyEvent(aWindow)["DOM_" + aKey];
-     else
-       charCode = aKey.charCodeAt(0);
- 
-@@ -555,8 +571,6 @@ function synthesizeDrop(srcElement, destElement, dragData, dropEffect, aWindow)
- 
- function disableNonTestMouseEvents(aDisable)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils =
-     window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
-            getInterface(Components.interfaces.nsIDOMWindowUtils);
-@@ -582,8 +596,6 @@ function _getDOMWindowUtils(aWindow)
-  */
- function synthesizeComposition(aIsCompositionStart, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return;
-@@ -635,8 +647,6 @@ function synthesizeComposition(aIsCompositionStart, aWindow)
-  */
- function synthesizeText(aEvent, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return;
-@@ -685,8 +695,6 @@ function synthesizeText(aEvent, aWindow)
-  */
- function synthesizeQuerySelectedText(aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return nullptr;
-@@ -707,8 +715,6 @@ function synthesizeQuerySelectedText(aWindow)
-  */
- function synthesizeQueryTextContent(aOffset, aLength, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return nullptr;
-@@ -728,8 +734,6 @@ function synthesizeQueryTextContent(aOffset, aLength, aWindow)
-  */
- function synthesizeQueryCaretRect(aOffset, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return nullptr;
-@@ -751,8 +755,6 @@ function synthesizeQueryCaretRect(aOffset, aWindow)
-  */
- function synthesizeQueryTextRect(aOffset, aLength, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return nullptr;
-@@ -770,8 +772,6 @@ function synthesizeQueryTextRect(aOffset, aLength, aWindow)
-  */
- function synthesizeQueryEditorRect(aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return nullptr;
-@@ -789,8 +789,6 @@ function synthesizeQueryEditorRect(aWindow)
-  */
- function synthesizeCharAtPoint(aX, aY, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return nullptr;
-@@ -813,8 +811,6 @@ function synthesizeCharAtPoint(aX, aY, aWindow)
-  */
- function synthesizeSelectionSet(aOffset, aLength, aReverse, aWindow)
- {
--  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
--
-   var utils = _getDOMWindowUtils(aWindow);
-   if (!utils) {
-     return false;
--- a/mailnews/addrbook/content/abDragDrop.js
+++ b/mailnews/addrbook/content/abDragDrop.js
@@ -165,18 +165,17 @@ var abDirTreeObserver = {
       return false;
 
     // XXX Due to bug 373125/bug 349044 we can't specify a default action,
     // so we default to move and this means that the user would have to press
     // ctrl to copy which most users don't realise.
     //
     // If target directory is a mailing list, then only allow copies.
     //    if (targetDirectory.isMailList &&
-    //   dragSession.dragAction != Components.interfaces.
-    //                             nsIDragService.DRAGDROP_ACTION_COPY)
+    //   dragSession.dragAction != Ci.nsIDragService.DRAGDROP_ACTION_COPY)
     //return false;
 
     var srcDirectory = GetDirectoryFromURI(srcURI);
 
     // Only allow copy from read-only directories.
     if (srcDirectory.readOnly &&
         dragSession.dragAction != Ci.
                                   nsIDragService.DRAGDROP_ACTION_COPY)
--- a/mailnews/base/search/content/FilterEditor.js
+++ b/mailnews/base/search/content/FilterEditor.js
@@ -288,17 +288,17 @@ function initializeFilterTypeSelector()
     menuitemBeforePlugins: document.getElementById("runBeforePlugins"),
     menuitemAfterPlugins: document.getElementById("runAfterPlugins"),
 
     checkBoxArchive: document.getElementById("runArchive"),
     checkBoxOutgoing: document.getElementById("runOutgoing"),
 
     /**
      * Returns the currently set filter type (checkboxes) in terms
-     * of a Components.interfaces.nsMsgFilterType value.
+     * of a Ci.nsMsgFilterType value.
      */
     getType: function()
     {
       let type = nsMsgFilterType.None;
 
       if (this.checkBoxManual.checked)
         type |= nsMsgFilterType.Manual;
 
@@ -323,17 +323,17 @@ function initializeFilterTypeSelector()
 
       return type;
     },
 
     /**
      * Sets the checkboxes to represent the filter type passed in.
      *
      * @param aType  the filter type to set in terms
-     *               of Components.interfaces.nsMsgFilterType values.
+     *               of Ci.nsMsgFilterType values.
      */
     setType: function(aType)
     {
       // If there is no type (event) requested, force "when manually run"
       if (aType == nsMsgFilterType.None)
         aType = nsMsgFilterType.Manual;
 
       this.checkBoxManual.checked   = aType & nsMsgFilterType.Manual;
--- a/mailnews/db/gloda/content/glodacomplete.xml
+++ b/mailnews/db/gloda/content/glodacomplete.xml
@@ -24,28 +24,28 @@
 
             var existingItemsCount = this.richlistbox.childNodes.length;
             var item;
 
             // trim the leading/trailing whitespace
             var trimmedSearchString = controller.searchString.trim();
 
             // Unescape the URI spec for showing as an entry in the popup
-            let url = Cc["@mozilla.org/intl/texttosuburi;1"].
-              getService(Ci.nsITextToSubURI).
-              unEscapeURIForUI("UTF-8", controller.getValueAt(this._currentIndex));
+            let url = Cc["@mozilla.org/intl/texttosuburi;1"]
+                        .getService(Ci.nsITextToSubURI)
+                        .unEscapeURIForUI("UTF-8", controller.getValueAt(this._currentIndex));
 
             // Unlike our superclass, we create nodes every time because we have
             //  heterogeneous results and we cannot rely on the XBL bindings to
             //  to change fast enough.
             item = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "richlistitem");
 
-            var glodaCompleter =  Cc["@mozilla.org/autocomplete/search;1?name=gloda"].
-              getService(). //Components.interfaces.nsIAutoCompleteSearch)
-              wrappedJSObject;
+            let glodaCompleter = Cc["@mozilla.org/autocomplete/search;1?name=gloda"]
+                                   .getService(Ci.nsIAutoCompleteSearch)
+                                   .wrappedJSObject;
             var result = glodaCompleter.curResult;
 
             // set these attributes before we set the class
             // so that we can use them from the contructor
             var row = result.getObjectAt(this._currentIndex);
             var obj = row.item;
             item.setAttribute("text", trimmedSearchString);
             item.setAttribute("type", result.getStyleAt(this._currentIndex));
@@ -57,17 +57,17 @@
             item.className = "autocomplete-richlistitem";
             this.richlistbox.appendChild(item);
 
             this._currentIndex++;
           }
 
           // yield after each batch of items so that typing the url bar is responsive
           setTimeout(() => this._appendCurrentResult(), 0);
-        ]]>
+          ]]>
         </body>
       </method>
       <method name="_invalidate">
         <body>
           <![CDATA[
           setTimeout(() => this.adjustHeight(), 0);
 
           // remove all child nodes because we never want to reuse them.
--- a/mailnews/db/gloda/modules/index_msg.js
+++ b/mailnews/db/gloda/modules/index_msg.js
@@ -27,17 +27,17 @@ ChromeUtils.import("resource:///modules/
 ChromeUtils.import("resource:///modules/gloda/gloda.js");
 ChromeUtils.import("resource:///modules/gloda/collection.js");
 ChromeUtils.import("resource:///modules/gloda/connotent.js");
 
 ChromeUtils.import("resource:///modules/gloda/indexer.js");
 
 ChromeUtils.import("resource:///modules/gloda/mimemsg.js");
 
-// Components.results does not have mailnews error codes!
+// Cr does not have mailnews error codes!
 var NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE = 0x80550005;
 
 var GLODA_MESSAGE_ID_PROPERTY = "gloda-id";
 /**
  * Message header property to track dirty status; one of
  *  |GlodaIndexer.kMessageClean|, |GlodaIndexer.kMessageDirty|,
  *  |GlodaIndexer.kMessageFilthy|.
  */
--- a/mailnews/db/gloda/modules/log4moz.js
+++ b/mailnews/db/gloda/modules/log4moz.js
@@ -668,17 +668,17 @@ TimeAwareMemoryBucketAppender.prototype 
 
 function ConsoleAppender(formatter) {
   this._name = "ConsoleAppender";
   this._formatter = formatter;
 }
 ConsoleAppender.prototype = {
   __proto__: Appender.prototype,
 
-  // override to send Error and higher level messages to Components.utils.reportError()
+  // override to send Error and higher level messages to Cu.reportError()
   append: function CApp_append(message) {
     let stringMessage = this._formatter.format(message);
     if (message.level > Log4Moz.Level.Warn) {
       Cu.reportError(stringMessage);
     }
     this.doAppend(stringMessage);
   },