--- a/chat/components/src/imAccounts.js
+++ b/chat/components/src/imAccounts.js
@@ -562,17 +562,17 @@ imAccount.prototype = {
if (aPassword &&
this._connectionErrorReason == Ci.imIAccount.ERROR_MISSING_PASSWORD)
this._connectionErrorReason = Ci.imIAccount.NO_ERROR;
else if (!aPassword && this._passwordRequired)
this._connectionErrorReason = Ci.imIAccount.ERROR_MISSING_PASSWORD;
this._sendUpdateNotification();
},
_handleMasterPasswordException: function(aException) {
- if (aException.result != Components.results.NS_ERROR_ABORT)
+ if (aException.result != Cr.NS_ERROR_ABORT)
throw aException;
gUserCanceledMasterPasswordPrompt = true;
executeSoon(function () { gUserCanceledMasterPasswordPrompt = false; });
},
get autoLogin() {
let autoLogin = true;
--- a/chat/components/src/imContacts.js
+++ b/chat/components/src/imContacts.js
@@ -599,17 +599,17 @@ Contact.prototype = {
return this._buddies.length == 0 ||
this._buddies.every(b => b._empty);
},
mergeContact: function(aContact) {
// Avoid merging the contact with itself or merging into an
// already removed contact.
if (aContact.id == this.id || !(this.id in ContactsById))
- throw Components.results.NS_ERROR_INVALID_ARG;
+ throw Cr.NS_ERROR_INVALID_ARG;
this._ensureNotDummy();
let contact = ContactsById[aContact.id]; // remove XPConnect wrapper
// Copy all the contact-only tags first, otherwise they would be lost.
for (let tag of contact.getTags())
if (!contact._isTagInherited(tag))
this.addTag(tag);
@@ -638,17 +638,17 @@ Contact.prototype = {
this._buddies.splice(newPosition, 0, buddy);
this._updatePositions(Math.min(oldPosition, newPosition),
Math.max(oldPosition, newPosition));
buddy._notifyObservers("position-changed", String(newPosition));
this._updatePreferredBuddy(buddy);
},
adoptBuddy: function(aBuddy) {
if (aBuddy.contact.id == this.id)
- throw Components.results.NS_ERROR_INVALID_ARG;
+ throw Cr.NS_ERROR_INVALID_ARG;
let buddy = BuddiesById[aBuddy.id]; // remove XPConnect wrapper
buddy.contact = this;
this._updatePreferredBuddy(buddy);
},
_massRemove: false,
_removeBuddy: function(aBuddy) {
if (this._buddies.length == 1) {
@@ -708,19 +708,19 @@ Contact.prototype = {
}
statement.finalize();
},
detachBuddy: function(aBuddy) {
// Should return a new contact with the same list of tags.
let buddy = BuddiesById[aBuddy.id];
if (buddy.contact.id != this.id)
- throw Components.results.NS_ERROR_INVALID_ARG;
+ throw Cr.NS_ERROR_INVALID_ARG;
if (buddy.contact._buddies.length == 1)
- throw Components.results.NS_ERROR_UNEXPECTED;
+ throw Cr.NS_ERROR_UNEXPECTED;
// Save the list of tags, it may be destoyed if the buddy was the last one.
let tags = buddy.contact.getTags();
// Create a new dummy contact and use it for the detached buddy.
buddy.contact = new Contact();
buddy.contact._notifyObservers("added");
@@ -950,17 +950,17 @@ Buddy.prototype = {
get protocol() { return this._accounts[0].account.protocol; },
get userName() { return this._name; },
get normalizedName() { return this._key; },
_srvAlias: "",
_contact: null,
get contact() { return this._contact; },
set contact(aContact) /* not in imIBuddy */ {
if (aContact.id == this._contact.id)
- throw Components.results.NS_ERROR_INVALID_ARG;
+ throw Cr.NS_ERROR_INVALID_ARG;
this._notifyObservers("moved-out-of-contact");
this._contact._removeBuddy(this);
this._contact = aContact;
this._contact._buddies.push(this);
// Ensure all the inherited tags are in the new contact.
--- a/chat/components/src/logger.js
+++ b/chat/components/src/logger.js
@@ -214,18 +214,18 @@ LogWriter.prototype = {
},
_serialize: function cl_serialize(aString) {
// TODO cleanup once bug 102699 is fixed
let doc = getHiddenHTMLWindow().document;
let div = doc.createElementNS("http://www.w3.org/1999/xhtml", "div");
div.innerHTML = aString.replace(/\r?\n/g, "<br/>").replace(/<br>/gi, "<br/>");
const type = "text/plain";
let encoder =
- Components.classes["@mozilla.org/layout/documentEncoder;1?type=" + type]
- .createInstance(Components.interfaces.nsIDocumentEncoder);
+ Cc["@mozilla.org/layout/documentEncoder;1?type=" + type]
+ .createInstance(Ci.nsIDocumentEncoder);
encoder.init(doc, type, 0);
encoder.setContainerNode(div);
encoder.setNodeFixup({fixupNode: function(aNode, aSerializeKids) {
if (aNode.localName == "a" && aNode.hasAttribute("href")) {
let url = aNode.getAttribute("href");
let content = aNode.textContent;
if (url != content)
aNode.textContent = content + " (" + url + ")";
--- a/chat/content/browserRequest.js
+++ b/chat/content/browserRequest.js
@@ -1,15 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.import("resource:///modules/imServices.jsm");
-var wpl = Components.interfaces.nsIWebProgressListener;
+var wpl = Ci.nsIWebProgressListener;
var reporterListener = {
_isBusy: false,
get statusMeter() {
delete this.statusMeter;
return this.statusMeter = document.getElementById("statusbar-icon");
},
get securityButton() {
@@ -21,21 +21,21 @@ var reporterListener = {
return this.securityLabel = document.getElementById("security-status");
},
get securityDisplay() {
delete this.securityDisplay;
return this.securityDisplay = document.getElementById("security-display");
},
QueryInterface: function(aIID) {
- if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
- aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
- aIID.equals(Components.interfaces.nsISupports))
+ if (aIID.equals(Ci.nsIWebProgressListener) ||
+ aIID.equals(Ci.nsISupportsWeakReference) ||
+ aIID.equals(Ci.nsISupports))
return this;
- throw Components.results.NS_NOINTERFACE;
+ throw Cr.NS_NOINTERFACE;
},
onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in unsigned long*/ aStateFlags,
/*in nsresult*/ aStatus) {
if (aStateFlags & wpl.STATE_START &&
aStateFlags & wpl.STATE_IS_NETWORK) {
this.statusMeter.value = 0;
@@ -114,36 +114,36 @@ function cancelRequest()
{
reportUserClosed();
window.close();
}
function reportUserClosed()
{
let request = window.arguments[0];
- request.QueryInterface(Components.interfaces.prplIRequestBrowser);
+ request.QueryInterface(Ci.prplIRequestBrowser);
request.cancelled();
}
function loadRequestedUrl()
{
let request = window.arguments[0];
- request.QueryInterface(Components.interfaces.prplIRequestBrowser);
+ request.QueryInterface(Ci.prplIRequestBrowser);
document.getElementById("headerMessage").textContent = request.promptText;
let account = request.account;
document.getElementById("headerLabel").value =
account.protocol.name + " - " + account.name;
document.getElementById("headerImage").src =
account.protocol.iconBaseURI + "icon48.png";
let browser = document.getElementById("requestFrame");
browser.docShell.allowPlugins = false;
if (Services.prefs.getBoolPref("chat.browserRequest.disableJavascript"))
browser.docShell.allowJavascript = false;
browser.addProgressListener(reporterListener,
- Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+ Ci.nsIWebProgress.NOTIFY_ALL);
let url = request.url;
if (url != "")
browser.setAttribute("src", url);
request.loaded(window, browser.webProgress);
}
--- a/chat/content/convbrowser.xml
+++ b/chat/content/convbrowser.xml
@@ -83,17 +83,17 @@
<property name="docShell"
onget="return this._docShell || (this._docShell = this.boxObject.docShell);"
readonly="true"/>
<property name="messageManager"
readonly="true">
<getter>
<![CDATA[
- var owner = this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner);
+ var owner = this.QueryInterface(Ci.nsIFrameLoaderOwner);
if (!owner.frameLoader) {
return null;
}
return owner.frameLoader.messageManager;
]]>
</getter>
</property>
@@ -125,18 +125,18 @@
<![CDATA[
if (!this._fastFind) {
if (!("@mozilla.org/typeaheadfind;1" in Components.classes))
return null;
if (!this.docShell)
return null;
- this._fastFind = Components.classes["@mozilla.org/typeaheadfind;1"]
- .createInstance(Components.interfaces.nsITypeAheadFind);
+ this._fastFind = Cc["@mozilla.org/typeaheadfind;1"]
+ .createInstance(Ci.nsITypeAheadFind);
this._fastFind.init(this.docShell);
}
return this._fastFind;
]]>
</getter>
</property>
<field name="_lastSearchString">null</field>
@@ -195,30 +195,30 @@
<method name="enableMagicCopy">
<body>
<![CDATA[
this.contentWindow.controllers.insertControllerAt(0, this);
this.autoCopyEnabled = Services.clipboard.supportsSelectionClipboard() &&
Services.prefs.getBoolPref("clipboard.autocopy");
if (this.autoCopyEnabled) {
this.contentWindow.getSelection()
- .QueryInterface(Components.interfaces.nsISelectionPrivate)
+ .QueryInterface(Ci.nsISelectionPrivate)
.addSelectionListener(this);
}
]]>
</body>
</method>
<method name="disableMagicCopy">
<body>
<![CDATA[
this.contentWindow.controllers.removeController(this);
if (this.autoCopyEnabled) {
this.contentWindow.getSelection()
- .QueryInterface(Components.interfaces.nsISelectionPrivate)
+ .QueryInterface(Ci.nsISelectionPrivate)
.removeSelectionListener(this);
}
]]>
</body>
</method>
<field name="autoCopyEnabled">false</field>
<field name="magicCopyPref" readonly="true">"messenger.conversations.selections.magicCopyEnabled"</field>
@@ -252,17 +252,17 @@
]]>
</body>
</method>
<method name="addProgressListener">
<parameter name="aListener"/>
<body>
<![CDATA[
- this.webProgress.addProgressListener(aListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+ this.webProgress.addProgressListener(aListener, Ci.nsIWebProgress.NOTIFY_ALL);
]]>
</body>
</method>
<method name="removeProgressListener">
<parameter name="aListener"/>
<body>
<![CDATA[
@@ -510,18 +510,18 @@
// Close any open bubble.
this._lastMessage = null;
}
// Suppress this message unless it was an error message.
if (!aMsg.error)
return;
}
- let cs = Components.classes["@mozilla.org/txttohtmlconv;1"]
- .getService(Ci.mozITXTToHTMLConv);
+ let cs = Cc["@mozilla.org/txttohtmlconv;1"]
+ .getService(Ci.mozITXTToHTMLConv);
/*
* kStructPhrase creates tags for plaintext-markup like *bold*,
* /italics/, etc. We always use this; the content filter will
* filter it out if the user does not want styling.
*/
let csFlags = cs.kStructPhrase;
// Automatically find and link freetext URLs
if (!aMsg.noLinkification)
@@ -863,19 +863,19 @@
<method name="doCommand">
<parameter name="aCommand"/>
<body>
<![CDATA[
let selection = this.contentWindow.getSelection();
if (selection.isCollapsed)
return;
- Components.classes["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Ci.nsIClipboardHelper)
- .copyString(serializeSelection(selection));
+ Cc["@mozilla.org/widget/clipboardhelper;1"]
+ .getService(Ci.nsIClipboardHelper)
+ .copyString(serializeSelection(selection));
]]>
</body>
</method>
<method name="onEvent">
<parameter name="aCommand"/>
</method>
@@ -886,19 +886,19 @@
<parameter name="aReason"/>
<body>
<![CDATA[
if (!(aReason & Ci.nsISelectionListener.MOUSEUP_REASON ||
aReason & Ci.nsISelectionListener.SELECTALL_REASON ||
aReason & Ci.nsISelectionListener.KEYPRESS_REASON))
return; // we are still dragging, don't bother with the selection
- Components.classes["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Ci.nsIClipboardHelper)
- .copyStringToClipboard(serializeSelection(aSelection),
+ Cc["@mozilla.org/widget/clipboardhelper;1"]
+ .getService(Ci.nsIClipboardHelper)
+ .copyStringToClipboard(serializeSelection(aSelection),
Ci.nsIClipboard.kSelectionClipboard);
]]>
</body>
</method>
<method name="_exposeMethodsToContent">
<body>
<![CDATA[
@@ -913,24 +913,24 @@
<!-- nsIWebProgressListener implementation -->
<method name="onStateChange">
<parameter name="aProgress"/>
<parameter name="aRequest"/>
<parameter name="aStateFlags"/>
<parameter name="aStatus"/>
<body>
<![CDATA[
- const WPL = Components.interfaces.nsIWebProgressListener;
+ const WPL = Ci.nsIWebProgressListener;
if ((aStateFlags & WPL.STATE_IS_DOCUMENT) &&
(aStateFlags & WPL.STATE_STOP)) {
if (!this._loadState) {
try {
initHTMLDocument(this._conv, this.theme, this.contentDocument);
} catch(e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
}
this._loadState = 1;
this._exposeMethodsToContent();
// A common use case is to click somewhere in the conversation and
// start typing a command (often /me). If quick find is enabled, it
// will pick up the "/" keypress and open the findbar. See bug 1161930.
@@ -1240,17 +1240,17 @@
"_firstNonContextElt"];
var ourFieldValues = {};
var otherFieldValues = {};
for (var field of fieldsToSwap) {
ourFieldValues[field] = this[field];
otherFieldValues[field] = aOtherBrowser[field];
}
- this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
+ this.QueryInterface(Ci.nsIFrameLoaderOwner)
.swapFrameLoaders(aOtherBrowser);
for (var field of fieldsToSwap) {
this[field] = otherFieldValues[field];
aOtherBrowser[field] = ourFieldValues[field];
}
this._exposeMethodsToContent();
@@ -1290,19 +1290,19 @@
// allowed by our IM filters and exposed.
if (!uri.schemeIs("http") && !uri.schemeIs("https"))
return;
event.preventDefault();
event.stopPropagation();
// loadURI can throw if the default browser is misconfigured.
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService)
- .loadURI(uri);
+ 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);"/>
<handler event="keypress" modifiers="shift" keycode="VK_PAGE_DOWN"
--- a/chat/modules/imContentSink.jsm
+++ b/chat/modules/imContentSink.jsm
@@ -250,18 +250,18 @@ function cleanupNode(aNode, aRules, aTex
for (let i = 0; i < aNode.childNodes.length; ++i) {
let node = aNode.childNodes[i];
if (node.nodeType == node.ELEMENT_NODE &&
node.namespaceURI == "http://www.w3.org/1999/xhtml") {
// check if node allowed
let nodeName = node.localName;
if (!(nodeName in aRules.tags)) {
if (nodeName in kForbiddenTags) {
- Components.utils.reportError("removing a " + nodeName +
- " tag from a message before display");
+ Cu.reportError("removing a " + nodeName +
+ " tag from a message before display");
}
else {
// this node is not allowed, replace it with its children
while (node.hasChildNodes())
aNode.insertBefore(node.removeChild(node.firstChild), node);
}
aNode.removeChild(node);
// We want to process again the node at the index i which is
@@ -335,17 +335,17 @@ function cleanupNode(aNode, aRules, aTex
let textNodeCount = 1;
for (let modifier of aTextModifiers)
for (let n = 0; n < textNodeCount; ++n) {
let textNode = aNode.childNodes[i + n];
// If we are processing nodes created by one of the previous
// text modifier function, some of the nodes are likely not
// text node, skip them.
- if (!(textNode instanceof Components.interfaces.nsIDOMText))
+ if (!(textNode instanceof Ci.nsIDOMText))
continue;
let result = modifier(textNode);
textNodeCount += result;
n += result;
}
// newly created nodes should not be filtered, be sure we skip them!
@@ -354,16 +354,16 @@ function cleanupNode(aNode, aRules, aTex
}
}
function cleanupImMarkup(aText, aRuleset, aTextModifiers = [])
{
if (!gGlobalRuleset)
initGlobalRuleset();
- let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
- .createInstance(Components.interfaces.nsIDOMParser);
+ let parser = Cc["@mozilla.org/xmlextras/domparser;1"]
+ .createInstance(Ci.nsIDOMParser);
// Wrap the text to be parsed in a <span> to avoid losing leading whitespace.
let doc = parser.parseFromString("<span>" + aText + "</span>", "text/html");
let span = doc.querySelector("span");
cleanupNode(span, aRuleset || gGlobalRuleset, aTextModifiers);
return span.innerHTML;
}
--- a/chat/modules/imSmileys.jsm
+++ b/chat/modules/imSmileys.jsm
@@ -44,19 +44,19 @@ var gPrefObserver = {
throw "bad notification";
gTheme = getTheme();
}
};
function getSmileRealURI(aSmile)
{
- aSmile = Components.classes["@mozilla.org/intl/texttosuburi;1"]
- .getService(Components.interfaces.nsITextToSubURI)
- .unEscapeURIForUI("UTF-8", aSmile);
+ aSmile = Cc["@mozilla.org/intl/texttosuburi;1"]
+ .getService(Ci.nsITextToSubURI)
+ .unEscapeURIForUI("UTF-8", aSmile);
if (aSmile in gTheme.iconsHash)
return gTheme.baseUri + gTheme.iconsHash[aSmile].filename;
throw "Invalid smile!";
}
function getSmileyList(aThemeName)
{
@@ -89,48 +89,48 @@ function getTheme(aName)
if (name == "default")
theme.baseUri = "chrome://instantbird-emoticons/skin/";
else
theme.baseUri = "chrome://" + theme.name + "/skin/";
try {
let channel = Services.io.newChannel2(theme.baseUri + kThemeFile, null, null, null,
Services.scriptSecurityManager.getSystemPrincipal(),
null,
- Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
- Components.interfaces.nsIContentPolicy.TYPE_IMAGE);
+ Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
+ Ci.nsIContentPolicy.TYPE_IMAGE);
let stream = channel.open();
let bytes = NetUtil.readInputStream(stream, stream.available());
theme.json = JSON.parse(gTextDecoder.decode(bytes));
stream.close();
theme.iconsHash = {};
for (let smiley of theme.json.smileys) {
for (let textCode of smiley.textCodes)
theme.iconsHash[textCode] = smiley;
}
} catch(e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
}
return theme;
}
function getRegexp()
{
if (gTheme.regExp) {
gTheme.regExp.lastIndex = 0;
return gTheme.regExp;
}
// return null if smileys are disabled
if (!gTheme.iconsHash)
return null;
if ("" in gTheme.iconsHash) {
- Components.utils.reportError("Emoticon " +
- gTheme.iconsHash[""].filename +
- " matches the empty string!");
+ Cu.reportError("Emoticon " +
+ gTheme.iconsHash[""].filename +
+ " matches the empty string!");
delete gTheme.iconsHash[""];
}
let emoticonList = [];
for (let emoticon in gTheme.iconsHash)
emoticonList.push(emoticon);
let exp = /[[\]{}()*+?.\\^$|]/g;
@@ -205,17 +205,17 @@ function smileTextNode(aNode)
function smileNode(aNode)
{
for (let i = 0; i < aNode.childNodes.length; ++i) {
let node = aNode.childNodes[i];
if (node.nodeType == node.ELEMENT_NODE &&
node.namespaceURI == "http://www.w3.org/1999/xhtml") {
// we are on a tag, recurse to process its children
smileNode(node);
- } else if (node instanceof Components.interfaces.nsIDOMText) {
+ } else if (node instanceof Ci.nsIDOMText) {
// we are on a text node, process it
smileTextNode(node);
}
}
}
function smileImMarkup(aDocument, aText)
{
--- a/chat/modules/imThemes.jsm
+++ b/chat/modules/imThemes.jsm
@@ -48,24 +48,24 @@ function getChromeFile(aURI)
{
try {
let channel = Services.io.newChannel2(aURI, null, null, null,
Services.scriptSecurityManager.getSystemPrincipal(),
null,
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
Ci.nsIContentPolicy.TYPE_OTHER);
let stream = channel.open();
- let sstream = Components.classes["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Ci.nsIScriptableInputStream);
+ let sstream = Cc["@mozilla.org/scriptableinputstream;1"]
+ .createInstance(Ci.nsIScriptableInputStream);
sstream.init(stream);
let text = sstream.read(sstream.available());
sstream.close();
return text;
} catch (e) {
- if (e.result != Components.results.NS_ERROR_FILE_NOT_FOUND)
+ if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND)
dump("Getting " + aURI + ": " + e + "\n");
return null;
}
}
function HTMLTheme(aBaseURI)
{
let files = {
@@ -157,29 +157,29 @@ function getInfoPlistContent(aBaseURI)
{
try {
let channel = Services.io.newChannel2(aBaseURI + "Info.plist", null, null, null,
Services.scriptSecurityManager.getSystemPrincipal(),
null,
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
Ci.nsIContentPolicy.TYPE_OTHER);
let stream = channel.open();
- let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
- .createInstance(Ci.nsIDOMParser);
+ let parser = Cc["@mozilla.org/xmlextras/domparser;1"]
+ .createInstance(Ci.nsIDOMParser);
let doc = parser.parseFromStream(stream, null, stream.available(), "text/xml");
if (doc.documentElement.localName != "plist")
throw "Invalid Info.plist file";
let node = doc.documentElement.firstChild;
while (node && !(node instanceof Ci.nsIDOMElement))
node = node.nextSibling;
if (!node || node.localName != "dict")
throw "Empty or invalid Info.plist file";
return plistToJSON(node);
} catch(e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
return null;
}
}
function getChromeBaseURI(aThemeName)
{
if (DEFAULT_THEMES.includes(aThemeName))
return "chrome://messenger-messagestyles/skin/" + aThemeName + "/";
@@ -212,50 +212,50 @@ function getCurrentTheme()
if (gCurrentTheme && gCurrentTheme.name == name &&
gCurrentTheme.variant == variant)
return gCurrentTheme;
try {
gCurrentTheme = getThemeByName(name);
gCurrentTheme.variant = variant;
} catch(e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
gCurrentTheme = getThemeByName(DEFAULT_THEME);
gCurrentTheme.variant = "default";
}
return gCurrentTheme;
}
function getDirectoryEntries(aDir)
{
let ios = Services.io;
let uri = ios.newURI(aDir);
- let cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Ci.nsIXULChromeRegistry);
+ let cr = Cc["@mozilla.org/chrome/chrome-registry;1"]
+ .getService(Ci.nsIXULChromeRegistry);
while (uri.scheme == "chrome")
uri = cr.convertChromeURL(uri);
// remove any trailing file name added by convertChromeURL
let spec = uri.spec.replace(/[^\/]+$/, "");
uri = ios.newURI(spec);
let results = [];
if (uri.scheme == "jar") {
uri.QueryInterface(Ci.nsIJARURI);
let strEntry = uri.JAREntry;
if (!strEntry)
return [];
- let zr = Components.classes["@mozilla.org/libjar/zip-reader;1"]
- .createInstance(Ci.nsIZipReader);
+ let zr = Cc["@mozilla.org/libjar/zip-reader;1"]
+ .createInstance(Ci.nsIZipReader);
let jarFile = uri.JARFile;
if (jarFile instanceof Ci.nsIJARURI) {
- let innerZr = Components.classes["@mozilla.org/libjar/zip-reader;1"]
- .createInstance(Ci.nsIZipReader);
+ let innerZr = Cc["@mozilla.org/libjar/zip-reader;1"]
+ .createInstance(Ci.nsIZipReader);
innerZr.open(jarFile.JARFile.QueryInterface(Ci.nsIFileURL).file);
zr.openInner(innerZr, jarFile.JAREntry);
}
else
zr.open(jarFile.QueryInterface(Ci.nsIFileURL).file);
if (!zr.hasEntry(strEntry) || !zr.getEntry(strEntry).isDirectory) {
zr.close();
@@ -461,18 +461,18 @@ function replaceKeywordsInHTML(aHTML, aR
let previousIndex = 0;
let result = "";
let match;
while ((match = kReplacementRegExp.exec(aHTML))) {
let content = "";
if (match[1] in aReplacements)
content = aReplacements[match[1]](aReplacementArg, match[3]);
else
- Components.utils.reportError("Unknown replacement string %" +
- match[1] + "% in message styles.");
+ Cu.reportError("Unknown replacement string %" +
+ match[1] + "% in message styles.");
result += aHTML.substring(previousIndex, match.index) + content;
previousIndex = kReplacementRegExp.lastIndex;
}
return result + aHTML.slice(previousIndex);
}
function isNextMessage(aTheme, aMsg, aPreviousMsg)
@@ -652,18 +652,18 @@ function getEllipsis()
function _serializeDOMObject(aDocument, aInitFunction)
{
// This shouldn't really be a constant, as we want to support
// text/html too in the future.
const type = "text/plain";
let encoder =
- Components.classes["@mozilla.org/layout/documentEncoder;1?type=" + type]
- .createInstance(Ci.nsIDocumentEncoder);
+ Cc["@mozilla.org/layout/documentEncoder;1?type=" + type]
+ .createInstance(Ci.nsIDocumentEncoder);
encoder.init(aDocument, type, Ci.nsIDocumentEncoder.OutputPreformatted);
aInitFunction(encoder);
let result = encoder.encodeToString();
return result;
}
function serializeRange(aRange)
{
--- a/chat/protocols/jsTest/jsTestProtocol.js
+++ b/chat/protocols/jsTest/jsTestProtocol.js
@@ -45,17 +45,17 @@ Account.prototype = {
this.reportConnected();
setTimeout((function() {
this._conv = new Conversation(this);
this._conv.writeMessage("jstest", "You are now talking to /dev/null", {system: true});
}).bind(this), 0);
},
_conv: null,
disconnect: function(aSilent) {
- this.reportDisconnecting(Components.interfaces.prplIAccount.NO_ERROR, "");
+ this.reportDisconnecting(Ci.prplIAccount.NO_ERROR, "");
if (!aSilent)
this._conv.writeMessage("jstest", "You have disconnected.", {system: true});
if (this._conv) {
this._conv._setDisconnected();
delete this._conv;
}
this.reportDisconnected();
},
--- a/common/bindings/preferences.xml
+++ b/common/bindings/preferences.xml
@@ -70,17 +70,17 @@
<body>
<![CDATA[
// Value changed, synthesize an event
try {
var event = document.createEvent("Events");
event.initEvent("change", true, true);
aPreference.dispatchEvent(event);
} catch (e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
}
]]>
</body>
</method>
<field name="service">
Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
@@ -144,18 +144,18 @@
return;
this.preferences.rootBranchInternal
.addObserver(this.name, this.preferences);
// In non-instant apply mode, we must try and use the last saved state
// from any previous opens of a child dialog instead of the value from
// preferences, to pick up any edits a user may have made.
- var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Components.interfaces.nsIScriptSecurityManager);
+ var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
+ .getService(Ci.nsIScriptSecurityManager);
if (this.preferences.type == "child" &&
!this.instantApply && window.opener &&
secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
var pdoc = window.opener.document;
// Try to find a preference element for the same preference.
var preference = null;
var parentPreferences = pdoc.getElementsByTagName("preferences");
@@ -335,18 +335,18 @@
</getter>
</property>
<field name="batching">false</field>
<method name="_reportUnknownType">
<body>
<![CDATA[
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
+ var consoleService = Cc["@mozilla.org/consoleservice;1"]
+ .getService(Ci.nsIConsoleService);
var msg = "<preference> with id='" + this.id + "' and name='" +
this.name + "' has unknown type '" + this.type + "'.";
consoleService.logStringMessage(msg);
]]>
</body>
</method>
<property name="valueFromPreferences">
@@ -357,29 +357,29 @@
switch (this.type) {
case "int":
return this._branch.getIntPref(this.name);
case "bool":
var val = this._branch.getBoolPref(this.name);
return this.inverted ? !val : val;
case "wstring":
return this._branch
- .getComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString)
+ .getComplexValue(this.name, Ci.nsIPrefLocalizedString)
.data;
case "string":
case "unichar":
return this._branch.getStringPref(this.name);
case "fontname":
var family = this._branch.getStringPref(this.name);
- var fontEnumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
- .createInstance(Components.interfaces.nsIFontEnumerator);
+ var fontEnumerator = Cc["@mozilla.org/gfx/fontenumerator;1"]
+ .createInstance(Ci.nsIFontEnumerator);
return fontEnumerator.getStandardFamilyName(family);
case "file":
var f = this._branch
- .getComplexValue(this.name, Components.interfaces.nsIFile);
+ .getComplexValue(this.name, Ci.nsIFile);
return f;
default:
this._reportUnknownType();
}
} catch (e) { }
return null;
]]>
</getter>
@@ -399,39 +399,39 @@
switch (this.type) {
case "int":
this.preferences.rootBranch.setIntPref(this.name, val);
break;
case "bool":
this.preferences.rootBranch.setBoolPref(this.name, this.inverted ? !val : val);
break;
case "wstring":
- var pls = Components.classes["@mozilla.org/pref-localizedstring;1"]
- .createInstance(Components.interfaces.nsIPrefLocalizedString);
+ var pls = Cc["@mozilla.org/pref-localizedstring;1"]
+ .createInstance(Ci.nsIPrefLocalizedString);
pls.data = val;
this.preferences.rootBranch
- .setComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString, pls);
+ .setComplexValue(this.name, Ci.nsIPrefLocalizedString, pls);
break;
case "string":
case "unichar":
case "fontname":
this.preferences.rootBranch.setStringPref(this.name, val);
break;
case "file":
var lf;
if (typeof(val) == "string") {
- lf = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsIFile);
+ lf = Cc["@mozilla.org/file/local;1"]
+ .createInstance(Ci.nsIFile);
lf.persistentDescriptor = val;
if (!lf.exists())
lf.initWithPath(val);
} else
- lf = val.QueryInterface(Components.interfaces.nsIFile);
+ lf = val.QueryInterface(Ci.nsIFile);
this.preferences.rootBranch
- .setComplexValue(this.name, Components.interfaces.nsIFile, lf);
+ .setComplexValue(this.name, Ci.nsIFile, lf);
break;
default:
this._reportUnknownType();
}
if (!this.batching)
this.preferences.service.savePrefFile(null);
return val;
]]>
@@ -453,17 +453,17 @@
// Value changed, synthesize an event
try {
var event = document.createEvent("Events");
event.initEvent("syncfrompreference", true, true);
var f = new Function("event",
aElement.getAttribute("onsyncfrompreference"));
rv = f.call(aElement, event);
} catch (e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
}
}
var val = rv;
if (val === undefined)
val = this.instantApply ? this.valueFromPreferences : this.value;
// if the preference is marked for reset, show default value in UI
if (val === undefined)
val = this.defaultValue;
@@ -508,17 +508,17 @@
var event = document.createEvent("Events");
event.initEvent("synctopreference", true, true);
var f = new Function("event",
aElement.getAttribute("onsynctopreference"));
var rv = f.call(aElement, event);
if (rv !== undefined)
return rv;
} catch (e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
}
}
/**
* Read the value of an attribute from an element, assuming the
* attribute is a property on the element's node API. If the property
* is not present in the API, then assume its value is contained in
* an attribute, as is the case before a binding has been attached.
@@ -635,18 +635,18 @@
<children/>
</xul:hbox>
</content>
<implementation implements="nsITimerCallback">
<constructor>
<![CDATA[
if (this.type != "child") {
if (!this._instantApplyInitialized) {
- let psvc = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
+ let psvc = Cc["@mozilla.org/preferences-service;1"]
+ .getService(Ci.nsIPrefBranch);
this.instantApply = psvc.getBoolPref("browser.preferences.instantApply");
}
if (this.instantApply) {
var docElt = document.documentElement;
var acceptButton = docElt.getButton("accept");
acceptButton.hidden = true;
var cancelButton = docElt.getButton("cancel");
if (/Mac/.test(navigator.platform)) {
@@ -809,17 +809,17 @@
if (aTarget.hasAttribute("on" + aEventName)) {
var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
var rv = fn.call(aTarget, event);
if (!rv)
cancel = true;
}
return !cancel;
} catch (e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
}
return false;
]]>
</body>
</method>
<field name="_initialized">false</field>
<method name="_selectPane">
@@ -894,18 +894,18 @@
}
]]>
</body>
</method>
<property name="_shouldAnimate">
<getter>
<![CDATA[
- var psvc = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
+ var psvc = Cc["@mozilla.org/preferences-service;1"]
+ .getService(Ci.nsIPrefBranch);
return psvc.getBoolPref("browser.preferences.animateFadeIn",
/Mac/.test(navigator.platform));
]]>
</getter>
</property>
<method name="animate">
<parameter name="aOldPane"/>
@@ -972,39 +972,39 @@
</body>
</method>
<method name="_setUpAnimationTimer">
<parameter name="aStartHeight"/>
<body>
<![CDATA[
if (!this._animateTimer)
- this._animateTimer = Components.classes["@mozilla.org/timer;1"]
- .createInstance(Components.interfaces.nsITimer);
+ this._animateTimer = Cc["@mozilla.org/timer;1"]
+ .createInstance(Ci.nsITimer);
else
this._animateTimer.cancel();
this._currentHeight = aStartHeight;
this._animateTimer.initWithCallback(this, this._animateDelay,
- Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
+ Ci.nsITimer.TYPE_REPEATING_SLACK);
]]>
</body>
</method>
<method name="_setUpFadeTimer">
<body>
<![CDATA[
if (!this._fadeTimer)
- this._fadeTimer = Components.classes["@mozilla.org/timer;1"]
- .createInstance(Components.interfaces.nsITimer);
+ this._fadeTimer = Cc["@mozilla.org/timer;1"]
+ .createInstance(Ci.nsITimer);
else
this._fadeTimer.cancel();
this._fadeTimer.initWithCallback(this, this._fadeDelay,
- Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
+ Ci.nsITimer.TYPE_REPEATING_SLACK);
]]>
</body>
</method>
<field name="_animateTimer">null</field>
<field name="_fadeTimer">null</field>
<field name="_animateDelay">15</field>
<field name="_animateIncrement">40</field>
@@ -1037,18 +1037,18 @@
<method name="openWindow">
<parameter name="aWindowType"/>
<parameter name="aURL"/>
<parameter name="aFeatures"/>
<parameter name="aParams"/>
<body>
<![CDATA[
- var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
- .getService(Components.interfaces.nsIWindowMediator);
+ var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
+ .getService(Ci.nsIWindowMediator);
var win = aWindowType ? wm.getMostRecentWindow(aWindowType) : null;
if (win) {
if ("initWithParams" in win)
win.initWithParams(aParams);
win.focus();
} else {
var features = "resizable,dialog=no,centerscreen" + (aFeatures != "" ? ("," + aFeatures) : "");
var parentWindow = (this.instantApply || !window.opener || window.opener.closed) ? window : window.opener;
@@ -1061,18 +1061,18 @@
</implementation>
<handlers>
<handler event="dialogaccept">
<![CDATA[
if (!this._fireEvent("beforeaccept", this)) {
return false;
}
- var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Components.interfaces.nsIScriptSecurityManager);
+ var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
+ .getService(Ci.nsIScriptSecurityManager);
if (this.type == "child" && window.opener &&
secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
var pdocEl = window.opener.document.documentElement;
if (pdocEl.instantApply) {
let panes = this.preferencePanes;
for (let i = 0; i < panes.length; ++i)
panes[i].writePreferences(true);
} else {
@@ -1118,18 +1118,18 @@
}
}
}
} else {
let panes = this.preferencePanes;
for (var i = 0; i < panes.length; ++i)
panes[i].writePreferences(false);
- let psvc = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
+ let psvc = Cc["@mozilla.org/preferences-service;1"]
+ .getService(Ci.nsIPrefService);
psvc.savePrefFile(null);
}
return true;
]]>
</handler>
<handler event="command">
if (event.originalTarget.hasAttribute("pane")) {
@@ -1188,18 +1188,18 @@
var preferences = this.preferences;
for (var i = 0; i < preferences.length; ++i) {
var preference = preferences[i];
preference.batching = true;
preference.valueFromPreferences = preference.value;
preference.batching = false;
}
if (aFlushToDisk) {
- var psvc = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
+ var psvc = Cc["@mozilla.org/preferences-service;1"]
+ .getService(Ci.nsIPrefService);
psvc.savePrefFile(null);
}
]]>
</body>
</method>
<property name="src"
onget="return this.getAttribute('src');"
--- a/editor/ui/composer/content/ComposerCommands.js
+++ b/editor/ui/composer/content/ComposerCommands.js
@@ -115,24 +115,24 @@ function SetupComposerWindowCommands()
var windowControllers = window.controllers;
if (!windowControllers) return;
var commandTable;
var composerController;
var editorController;
try {
- composerController = Components.classes["@mozilla.org/embedcomp/base-command-controller;1"].createInstance();
-
- editorController = composerController.QueryInterface(Components.interfaces.nsIControllerContext);
+ composerController = Cc["@mozilla.org/embedcomp/base-command-controller;1"].createInstance();
+
+ editorController = composerController.QueryInterface(Ci.nsIControllerContext);
editorController.init(null); // init it without passing in a command table
// Get the nsIControllerCommandTable interface we need to register commands
- var interfaceRequestor = composerController.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- commandTable = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandTable);
+ var interfaceRequestor = composerController.QueryInterface(Ci.nsIInterfaceRequestor);
+ commandTable = interfaceRequestor.getInterface(Ci.nsIControllerCommandTable);
}
catch (e)
{
dump("Failed to create composerController\n");
return;
}
@@ -187,42 +187,42 @@ function GetComposerCommandTable()
{
try {
controller = window.content.controllers.getControllerById(gComposerJSCommandControllerID);
} catch (e) {}
}
if (!controller)
{
//create it
- controller = Components.classes["@mozilla.org/embedcomp/base-command-controller;1"].createInstance();
-
- var editorController = controller.QueryInterface(Components.interfaces.nsIControllerContext);
+ controller = Cc["@mozilla.org/embedcomp/base-command-controller;1"].createInstance();
+
+ var editorController = controller.QueryInterface(Ci.nsIControllerContext);
editorController.init(null);
editorController.setCommandContext(GetCurrentEditorElement());
window.content.controllers.insertControllerAt(0, controller);
// Store the controller ID so we can be sure to get the right one later
gComposerJSCommandControllerID = window.content.controllers.getControllerId(controller);
}
if (controller)
{
- var interfaceRequestor = controller.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- return interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandTable);
+ var interfaceRequestor = controller.QueryInterface(Ci.nsIInterfaceRequestor);
+ return interfaceRequestor.getInterface(Ci.nsIControllerCommandTable);
}
return null;
}
//-----------------------------------------------------------------------------------
function goUpdateCommandState(command)
{
try
{
var controller = top.document.commandDispatcher.getControllerForCommand(command);
- if (!(controller instanceof Components.interfaces.nsICommandController))
+ if (!(controller instanceof Ci.nsICommandController))
return;
var params = newCommandParams();
if (!params) return;
controller.getCommandStateWithParams(command, params);
switch (command)
@@ -297,17 +297,17 @@ function goUpdateComposerMenuItems(comma
//-----------------------------------------------------------------------------------
function goDoCommandParams(command, params)
{
try
{
var controller = top.document.commandDispatcher.getControllerForCommand(command);
if (controller && controller.isCommandEnabled(command))
{
- if (controller instanceof Components.interfaces.nsICommandController)
+ if (controller instanceof Ci.nsICommandController)
{
controller.doCommandWithParams(command, params);
// the following two lines should be removed when we implement observers
if (params)
controller.getCommandStateWithParams(command, params);
}
else
@@ -369,17 +369,17 @@ function pokeMultiStateUI(uiID, cmdParam
return;
var isMixed = cmdParams.getBooleanValue("state_mixed");
var desiredAttrib;
if (isMixed)
desiredAttrib = "mixed";
else {
var valuetype = cmdParams.getValueType("state_attribute");
- if (valuetype == Components.interfaces.nsICommandParams.eStringType) {
+ if (valuetype == Ci.nsICommandParams.eStringType) {
desiredAttrib = cmdParams.getCStringValue("state_attribute");
// Decode UTF-8, for example for font names in Japanese.
desiredAttrib = new TextDecoder("UTF-8").decode(stringToTypedArray(desiredAttrib));
} else {
desiredAttrib = cmdParams.getStringValue("state_attribute");
}
}
@@ -467,17 +467,17 @@ var nsOpenCommand =
getCommandStateParams: function(aCommand, aParams, aRefCon) {},
doCommandParams: function(aCommand, aParams, aRefCon) {},
doCommand: function(aCommand)
{
var fileType = IsHTMLEditor() ? "html" : "text";
var title = GetString(IsHTMLEditor() ? "OpenHTMLFile" : "OpenTextFile");
- var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+ var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
fp.init(window, title, nsIFilePicker.modeOpen);
SetFilePickerDirectory(fp, fileType);
// Direct user to prefer HTML files and/or text files depending on whether
// loading into Composer or Text editor, so we call separately to control
// the order of the filter list.
if (fileType == "html")
@@ -722,18 +722,18 @@ var nsPublishAsCommand =
// ------- output utilites ----- //
// returns a fileExtension string
function GetExtensionBasedOnMimeType(aMIMEType)
{
try {
var mimeService = null;
- mimeService = Components.classes["@mozilla.org/mime;1"]
- .getService(Components.interfaces.nsIMIMEService);
+ mimeService = Cc["@mozilla.org/mime;1"]
+ .getService(Ci.nsIMIMEService);
var fileExtension = mimeService.getPrimaryExtension(aMIMEType, null);
// the MIME service likes to give back ".htm" for text/html files,
// so do a special-case fix here.
if (fileExtension == "htm")
fileExtension = "html";
@@ -750,17 +750,17 @@ function GetSuggestedFileName(aDocumentU
extension = "." + extension;
// check for existing file name we can use
if (aDocumentURLString && !IsUrlAboutBlank(aDocumentURLString))
{
try {
let docURI = Services.io.newURI(aDocumentURLString,
GetCurrentEditor().documentCharacterSet);
- docURI = docURI.QueryInterface(Components.interfaces.nsIURL);
+ docURI = docURI.QueryInterface(Ci.nsIURL);
// grab the file name
let url = validateFileName(decodeURIComponent(docURI.fileBaseName));
if (url)
return url + extension;
} catch(e) {}
}
@@ -778,17 +778,17 @@ function PromptForSaveLocation(aDoSaveAs
{
var dialogResult = {};
dialogResult.filepickerClick = nsIFilePicker.returnCancel;
dialogResult.resultingURI = "";
dialogResult.resultingLocalFile = null;
var fp = null;
try {
- fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+ fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
} catch (e) {}
if (!fp) return dialogResult;
// determine prompt string based on type of saving we'll do
var promptString;
if (aDoSaveAsText || aEditorType == "text")
promptString = GetString("SaveTextAs");
else
@@ -887,41 +887,41 @@ var gPersistObj;
// we need to update the uri before notifying listeners
// if (doUpdateURI)
// SetDocumentURI(docURI);
// UpdateWindowTitle();
// if (!aSaveCopy)
// editor.resetModificationCount();
// this should cause notification to listeners that document has changed
-const webPersist = Components.interfaces.nsIWebBrowserPersist;
+const webPersist = Ci.nsIWebBrowserPersist;
function OutputFileWithPersistAPI(editorDoc, aDestinationLocation, aRelatedFilesParentDir, aMimeType)
{
gPersistObj = null;
var editor = GetCurrentEditor();
try {
editor.forceCompositionEnd();
} catch (e) {}
var isLocalFile = false;
try {
- var tmp1 = aDestinationLocation.QueryInterface(Components.interfaces.nsIFile);
+ var tmp1 = aDestinationLocation.QueryInterface(Ci.nsIFile);
isLocalFile = true;
}
catch (e) {
try {
- var tmp = aDestinationLocation.QueryInterface(Components.interfaces.nsIURI);
+ var tmp = aDestinationLocation.QueryInterface(Ci.nsIURI);
isLocalFile = tmp.schemeIs("file");
}
catch (e) {}
}
try {
// we should supply a parent directory if/when we turn on functionality to save related documents
- var persistObj = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(webPersist);
+ var persistObj = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(webPersist);
persistObj.progressListener = gEditorOutputProgressListener;
var wrapColumn = GetWrapColumn();
var outputFlags = GetOutputFlags(aMimeType, wrapColumn);
// for 4.x parity as well as improving readability of file locally on server
// this will always send crlf for upload (http/ftp)
if (!isLocalFile) // if we aren't saving locally then send both cr and lf
@@ -986,34 +986,34 @@ function GetOutputFlags(aMimeType, aWrap
if (aWrapColumn > 0)
outputFlags |= webPersist.ENCODE_FLAGS_WRAP;
return outputFlags;
}
// returns number of column where to wrap
-const nsIWebBrowserPersist = Components.interfaces.nsIWebBrowserPersist;
+const nsIWebBrowserPersist = Ci.nsIWebBrowserPersist;
function GetWrapColumn()
{
try {
return GetCurrentEditor().wrapWidth;
} catch (e) {}
return 0;
}
const gShowDebugOutputStateChange = false;
const gShowDebugOutputProgress = false;
const gShowDebugOutputStatusChange = false;
const gShowDebugOutputLocationChange = false;
const gShowDebugOutputSecurityChange = false;
-const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
-const nsIChannel = Components.interfaces.nsIChannel;
+const nsIWebProgressListener = Ci.nsIWebProgressListener;
+const nsIChannel = Ci.nsIChannel;
const kErrorBindingAborted = 2152398850;
const kErrorBindingRedirected = 2152398851;
const kFileNotFound = 2152857618;
var gEditorOutputProgressListener =
{
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
@@ -1067,17 +1067,17 @@ var gEditorOutputProgressListener =
}
// Detect end of file upload of any file:
if (aStateFlags & nsIWebProgressListener.STATE_STOP)
{
// ignore aStatus == kErrorBindingAborted; check http response for possible errors
try {
// check http channel for response: 200 range is ok; other ranges are not
- var httpChannel = aRequest.QueryInterface(Components.interfaces.nsIHttpChannel);
+ var httpChannel = aRequest.QueryInterface(Ci.nsIHttpChannel);
var httpResponse = httpChannel.responseStatus;
if (httpResponse < 200 || httpResponse >= 300)
aStatus = httpResponse; // not a real error but enough to pass check below
else if (aStatus == kErrorBindingAborted)
aStatus = 0;
if (gShowDebugOutputStateChange)
dump("http response is: "+httpResponse+"\n");
@@ -1292,23 +1292,23 @@ var gEditorOutputProgressListener =
var channel = aRequest.QueryInterface(nsIChannel);
dump("***** onSecurityChange request: " + channel.URI.spec + "\n");
} catch (e) {}
}
},
QueryInterface : function(aIID)
{
- if (aIID.equals(Components.interfaces.nsIWebProgressListener)
- || aIID.equals(Components.interfaces.nsISupports)
- || aIID.equals(Components.interfaces.nsISupportsWeakReference)
- || aIID.equals(Components.interfaces.nsIPrompt)
- || aIID.equals(Components.interfaces.nsIAuthPrompt))
+ if (aIID.equals(Ci.nsIWebProgressListener)
+ || aIID.equals(Ci.nsISupports)
+ || aIID.equals(Ci.nsISupportsWeakReference)
+ || aIID.equals(Ci.nsIPrompt)
+ || aIID.equals(Ci.nsIAuthPrompt))
return this;
- throw Components.results.NS_NOINTERFACE;
+ throw Cr.NS_NOINTERFACE;
},
// nsIPrompt
alert : function(dlgTitle, text)
{
Services.prompt.alert(gProgressDialog ? gProgressDialog : window, dlgTitle, text);
},
alertCheck : function(dialogTitle, text, checkBoxLabel, checkObj)
@@ -1580,32 +1580,32 @@ function IsSupportedTextMimeType(aMimeTy
return false;
}
// throws an error or returns true if user attempted save; false if user canceled save
async function SaveDocument(aSaveAs, aSaveCopy, aMimeType)
{
var editor = GetCurrentEditor();
if (!aMimeType || !editor)
- throw Components.results.NS_ERROR_NOT_INITIALIZED;
+ throw Cr.NS_ERROR_NOT_INITIALIZED;
var editorDoc = editor.document;
if (!editorDoc)
- throw Components.results.NS_ERROR_NOT_INITIALIZED;
+ throw Cr.NS_ERROR_NOT_INITIALIZED;
// if we don't have the right editor type bail (we handle text and html)
var editorType = GetCurrentEditorType();
if (["text", "html", "htmlmail", "textmail"].indexOf(editorType) == -1)
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
+ throw Cr.NS_ERROR_NOT_IMPLEMENTED;
var saveAsTextFile = IsSupportedTextMimeType(aMimeType);
// check if the file is to be saved is a format we don't understand; if so, bail
if (aMimeType != kHTMLMimeType && aMimeType != kXHTMLMimeType && !saveAsTextFile)
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
+ throw Cr.NS_ERROR_NOT_IMPLEMENTED;
if (saveAsTextFile)
aMimeType = "text/plain";
var urlstring = GetDocumentUrl();
var mustShowFileDialog = (aSaveAs || IsUrlAboutBlank(urlstring) || (urlstring == ""));
// If editing a remote URL, force SaveAs dialog
@@ -1635,34 +1635,34 @@ async function SaveDocument(aSaveAs, aSa
replacing = (dialogResult.filepickerClick == nsIFilePicker.returnReplace);
urlstring = dialogResult.resultingURIString;
tempLocalFile = dialogResult.resultingLocalFile;
// update the new URL for the webshell unless we are saving a copy
if (!aSaveCopy)
doUpdateURI = true;
} catch (e) {
- Components.utils.reportError(e);
+ Cu.reportError(e);
return false;
}
} // mustShowFileDialog
var success = true;
try {
// if somehow we didn't get a local file but we did get a uri,
// attempt to create the localfile if it's a "file" url
var docURI;
if (!tempLocalFile)
{
docURI = Services.io.newURI(urlstring, editor.documentCharacterSet);
if (docURI.schemeIs("file"))
{
var fileHandler = GetFileProtocolHandler();
- tempLocalFile = fileHandler.getFileFromURLSpec(urlstring).QueryInterface(Components.interfaces.nsIFile);
+ tempLocalFile = fileHandler.getFileFromURLSpec(urlstring).QueryInterface(Ci.nsIFile);
}
}
// this is the location where the related files will go
var relatedFilesDir = null;
// Only change links or move files if pref is set
// and we are saving to a new location
@@ -2049,22 +2049,22 @@ async function CloseWindow()
// Check to make sure document is saved. "true" means allow "Don't Save" button,
// so user can choose to close without saving
if (await CheckAndSaveDocument("cmd_close", true))
{
if (window.InsertCharWindow)
SwitchInsertCharToAnotherEditorOrClose();
try {
- var basewin = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation)
- .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
+ var basewin = window.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIBaseWindow);
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIBaseWindow);
basewin.destroy();
} catch (e) {}
}
}
//-----------------------------------------------------------------------------------
var nsOpenRemoteCommand =
{
@@ -2312,25 +2312,25 @@ var nsFindAgainCommand =
};
//-----------------------------------------------------------------------------------
var nsRewrapCommand =
{
isCommandEnabled: function(aCommand, dummy)
{
return (IsDocumentEditable() && !IsInHTMLSourceMode() &&
- GetCurrentEditor() instanceof Components.interfaces.nsIEditorMailSupport);
+ GetCurrentEditor() instanceof Ci.nsIEditorMailSupport);
},
getCommandStateParams: function(aCommand, aParams, aRefCon) {},
doCommandParams: function(aCommand, aParams, aRefCon) {},
doCommand: function(aCommand)
{
- GetCurrentEditor().QueryInterface(Components.interfaces.nsIEditorMailSupport).rewrap(false);
+ GetCurrentEditor().QueryInterface(Ci.nsIEditorMailSupport).rewrap(false);
}
};
//-----------------------------------------------------------------------------------
var nsSpellingCommand =
{
isCommandEnabled: function(aCommand, dummy)
{
--- a/editor/ui/composer/content/editingOverlay.js
+++ b/editor/ui/composer/content/editingOverlay.js
@@ -59,28 +59,28 @@ function EditorOnLoad()
cmd.collapsed = true;
}
// Initialize our source text <editor>
try {
gSourceContentWindow = document.getElementById("content-source");
gSourceContentWindow.makeEditable("text", false);
gSourceTextEditor = gSourceContentWindow.getEditor(gSourceContentWindow.contentWindow);
- gSourceTextEditor.QueryInterface(Components.interfaces.nsIPlaintextEditor);
+ gSourceTextEditor.QueryInterface(Ci.nsIPlaintextEditor);
gSourceTextEditor.enableUndo(false);
gSourceTextEditor.rootElement.style.fontFamily = "-moz-fixed";
gSourceTextEditor.rootElement.style.whiteSpace = "pre";
gSourceTextEditor.rootElement.style.margin = 0;
- var controller = Components.classes["@mozilla.org/embedcomp/base-command-controller;1"]
- .createInstance(Components.interfaces.nsIControllerContext);
+ var controller = Cc["@mozilla.org/embedcomp/base-command-controller;1"]
+ .createInstance(Ci.nsIControllerContext);
controller.init(null);
controller.setCommandContext(gSourceContentWindow);
gSourceContentWindow.contentWindow.controllers.insertControllerAt(0, controller);
- var commandTable = controller.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIControllerCommandTable);
+ var commandTable = controller.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIControllerCommandTable);
commandTable.registerCommand("cmd_findReplace", nsFindReplaceCommand);
commandTable.registerCommand("cmd_find", nsFindCommand);
commandTable.registerCommand("cmd_findNext", nsFindAgainCommand);
commandTable.registerCommand("cmd_findPrev", nsFindAgainCommand);
} catch (e) {
dump("makeEditable failed: "+e+"\n");
}
}
@@ -160,21 +160,21 @@ var PrintPreviewListener = {
}
function EditorStartup(aUrl, aCharset)
{
gUntitledString = GetFormattedString("untitledTitle", GetNextUntitledValue());
var ds = GetCurrentEditorElement().docShell;
ds.useErrorPages = false;
- var root = ds.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
- .rootTreeItem.QueryInterface(Components.interfaces.nsIDocShell);
+ var root = ds.QueryInterface(Ci.nsIDocShellTreeItem)
+ .rootTreeItem.QueryInterface(Ci.nsIDocShell);
- root.QueryInterface(Components.interfaces.nsIDocShell).appType =
- Components.interfaces.nsIDocShell.APP_TYPE_EDITOR;
+ root.QueryInterface(Ci.nsIDocShell).appType =
+ Ci.nsIDocShell.APP_TYPE_EDITOR;
// EditorSharedStartup also used by Message Composer.
EditorSharedStartup();
// Commands specific to the Composer Application window,
// (i.e., not embedded editors)
// such as file-related commands, HTML Source editing, Edit Modes...
SetupComposerWindowCommands();
@@ -217,17 +217,17 @@ function EditorShutdown()
// --------------------------- File menu ---------------------------
// Check for changes to document and allow saving before closing
// This is hooked up to the OS's window close widget (e.g., "X" for Windows)
async function EditorCanClose(aCancelQuit, aTopic, aData)
{
if (aTopic == "quit-application-requested" &&
- aCancelQuit instanceof Components.interfaces.nsISupportsPRBool &&
+ aCancelQuit instanceof Ci.nsISupportsPRBool &&
aCancelQuit.data)
return false;
// Returns FALSE only if user cancels save action
// "true" means allow "Don't Save" button
var canClose = await CheckAndSaveDocument("cmd_close", true);
--- a/editor/ui/composer/content/editor.js
+++ b/editor/ui/composer/content/editor.js
@@ -51,17 +51,17 @@ var gReturnInParagraphPrefListener;
var gLocalFonts = null;
var gLastFocusNode = null;
var gLastFocusNodeWasSelected = false;
// These must be kept in synch with the XUL <options> lists
var gFontSizeNames = ["xx-small","x-small","small","medium","large","x-large","xx-large"];
-var nsIFilePicker = Components.interfaces.nsIFilePicker;
+var nsIFilePicker = Ci.nsIFilePicker;
var kEditorToolbarPrefs = "editor.toolbars.showbutton.";
var kUseCssPref = "editor.use_css";
var kCRInParagraphsPref = "editor.CR_creates_new_p";
function ShowHideToolbarSeparators(toolbar) {
// Make sure the toolbar actually exists.
if (!toolbar)
@@ -402,17 +402,17 @@ function SetFocusOnStartup()
gContentWindow.focus();
}
function EditorLoadUrl(url)
{
try {
if (url)
GetCurrentEditorElement().webNavigation.loadURI(url, // uri string
- Components.interfaces.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE, // load flags
+ Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE, // load flags
null, // referrer
null, // post-data stream
null);
} catch (e) { dump(" EditorLoadUrl failed: "+e+"\n"); }
}
// This should be called by all Composer types
function EditorSharedStartup()
@@ -1028,18 +1028,18 @@ const kFixedFontFaceMenuItems = 8;
function initLocalFontFaceMenu(menuPopup)
{
if (!gLocalFonts)
{
// Build list of all local fonts once per editor
try
{
- var enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
- .getService(Components.interfaces.nsIFontEnumerator);
+ var enumerator = Cc["@mozilla.org/gfx/fontenumerator;1"]
+ .getService(Ci.nsIFontEnumerator);
var localFontCount = { value: 0 }
gLocalFonts = enumerator.EnumerateAllFonts(localFontCount);
}
catch(e) { }
}
// Don't use radios for menulists.
let useRadioMenuitems = (menuPopup.parentNode.localName == "menu");
@@ -1589,17 +1589,17 @@ function EditorDblClick(event)
// We check event.explicitOriginalTarget here because .target will never
// be a textnode (bug 193689)
if (event.explicitOriginalTarget)
{
// Only bring up properties if clicked on an element or selected link
var element;
try {
element = event.explicitOriginalTarget.QueryInterface(
- Components.interfaces.nsIDOMElement);
+ Ci.nsIDOMElement);
} catch (e) {}
// We use "href" instead of "a" to not be fooled by named anchor
if (!element)
try {
element = GetCurrentEditor().getSelectedElement("href");
} catch (e) {}
@@ -1623,17 +1623,17 @@ function EditorClick(event)
// except for body and table elements
if (gEditorDisplayMode == kDisplayModeAllTags)
{
try
{
// We check event.explicitOriginalTarget here because .target will never
// be a textnode (bug 193689)
var element = event.explicitOriginalTarget.QueryInterface(
- Components.interfaces.nsIDOMElement);
+ Ci.nsIDOMElement);
var name = element.localName;
if (!["body", "caption", "table", "td", "th", "tr"].includes(name))
{
GetCurrentEditor().selectElement(event.explicitOriginalTarget);
event.preventDefault();
}
} catch (e) {}
}
@@ -1895,17 +1895,17 @@ function SetDisplayMode(mode)
{
// Save the last non-source mode so we can cancel source editing easily
gPreviousNonSourceDisplayMode = mode;
// Load/unload appropriate override style sheet
try {
var editor = GetCurrentEditor();
editor.QueryInterface(nsIEditorStyleSheets);
- editor instanceof Components.interfaces.nsIHTMLObjectResizer;
+ editor instanceof Ci.nsIHTMLObjectResizer;
switch (mode)
{
case kDisplayModePreview:
// Disable all extra "edit mode" style sheets
editor.enableStyleSheet(kNormalStyleSheet, false);
editor.enableStyleSheet(kAllTagsStyleSheet, false);
editor.objectResizingEnabled = true;
@@ -3164,19 +3164,19 @@ function FillInHTMLTooltipEditor(tooltip
tooltip.setAttribute("label", tooltipText);
return true;
}
}
}
} else {
for (node = document.tooltipNode; node; node = node.parentNode) {
if (ChromeUtils.getClassName(node) === "HTMLImageElement" ||
- node instanceof Components.interfaces.nsIDOMHTMLInputElement)
+ node instanceof Ci.nsIDOMHTMLInputElement)
tooltipText = node.getAttribute("src");
- else if (node instanceof Components.interfaces.nsIDOMHTMLAnchorElement)
+ else if (node instanceof Ci.nsIDOMHTMLAnchorElement)
tooltipText = node.getAttribute("href") || node.name;
if (tooltipText) {
tooltip.setAttribute("label", tooltipText);
return true;
}
}
}
return false;
--- a/editor/ui/composer/content/editorUtilities.js
+++ b/editor/ui/composer/content/editorUtilities.js
@@ -9,24 +9,24 @@ ChromeUtils.import("resource://gre/modul
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// Each editor window must include this file
// Variables shared by all dialogs:
// Object to attach commonly-used widgets (all dialogs should use this)
var gDialog = {};
-var kOutputEncodeBasicEntities = Components.interfaces.nsIDocumentEncoder.OutputEncodeBasicEntities;
-var kOutputEncodeHTMLEntities = Components.interfaces.nsIDocumentEncoder.OutputEncodeHTMLEntities;
-var kOutputEncodeLatin1Entities = Components.interfaces.nsIDocumentEncoder.OutputEncodeLatin1Entities;
-var kOutputEncodeW3CEntities = Components.interfaces.nsIDocumentEncoder.OutputEncodeW3CEntities;
-var kOutputFormatted = Components.interfaces.nsIDocumentEncoder.OutputFormatted;
-var kOutputLFLineBreak = Components.interfaces.nsIDocumentEncoder.OutputLFLineBreak;
-var kOutputSelectionOnly = Components.interfaces.nsIDocumentEncoder.OutputSelectionOnly;
-var kOutputWrap = Components.interfaces.nsIDocumentEncoder.OutputWrap;
+var kOutputEncodeBasicEntities = Ci.nsIDocumentEncoder.OutputEncodeBasicEntities;
+var kOutputEncodeHTMLEntities = Ci.nsIDocumentEncoder.OutputEncodeHTMLEntities;
+var kOutputEncodeLatin1Entities = Ci.nsIDocumentEncoder.OutputEncodeLatin1Entities;
+var kOutputEncodeW3CEntities = Ci.nsIDocumentEncoder.OutputEncodeW3CEntities;
+var kOutputFormatted = Ci.nsIDocumentEncoder.OutputFormatted;
+var kOutputLFLineBreak = Ci.nsIDocumentEncoder.OutputLFLineBreak;
+var kOutputSelectionOnly = Ci.nsIDocumentEncoder.OutputSelectionOnly;
+var kOutputWrap = Ci.nsIDocumentEncoder.OutputWrap;
var gStringBundle;
var gFilePickerDirectory;
/************* Message dialogs ***************/
// Optional: Caller may supply text to substitue for "Ok" and/or "Cancel"
function ConfirmWithTitle(title, message, okButtonText, cancelButtonText)
@@ -144,38 +144,38 @@ function GetSelectionAsText()
return GetCurrentEditor().outputToString("text/plain", kOutputSelectionOnly);
} catch (e) {}
return "";
}
/************* Get Current Editor and associated interfaces or info ***************/
-const nsIPlaintextEditor = Components.interfaces.nsIPlaintextEditor;
-const nsIHTMLEditor = Components.interfaces.nsIHTMLEditor;
-const nsITableEditor = Components.interfaces.nsITableEditor;
-const nsIEditorStyleSheets = Components.interfaces.nsIEditorStyleSheets;
-const nsIEditingSession = Components.interfaces.nsIEditingSession;
+const nsIPlaintextEditor = Ci.nsIPlaintextEditor;
+const nsIHTMLEditor = Ci.nsIHTMLEditor;
+const nsITableEditor = Ci.nsITableEditor;
+const nsIEditorStyleSheets = Ci.nsIEditorStyleSheets;
+const nsIEditingSession = Ci.nsIEditingSession;
function GetCurrentEditor()
{
// Get the active editor from the <editor> tag
// XXX This will probably change if we support > 1 editor in main Composer window
// (e.g. a plaintext editor for HTMLSource)
// For dialogs: Search up parent chain to find top window with editor
var editor;
try {
var editorElement = GetCurrentEditorElement();
editor = editorElement.getEditor(editorElement.contentWindow);
// Do QIs now so editor users won't have to figure out which interface to use
// Using "instanceof" does the QI for us.
- editor instanceof Components.interfaces.nsIPlaintextEditor;
- editor instanceof Components.interfaces.nsIHTMLEditor;
+ editor instanceof Ci.nsIPlaintextEditor;
+ editor instanceof Ci.nsIHTMLEditor;
} catch (e) { dump (e)+"\n"; }
return editor;
}
function GetCurrentTableEditor()
{
var editor = GetCurrentEditor();
@@ -297,17 +297,17 @@ function IsHTMLSourceChanged()
{
// gSourceTextEditor will not be defined if we're just a text editor.
return gSourceTextEditor ? gSourceTextEditor.documentModified : false;
}
function newCommandParams()
{
try {
- return Components.classes["@mozilla.org/embedcomp/command-params;1"].createInstance(Components.interfaces.nsICommandParams);
+ return Cc["@mozilla.org/embedcomp/command-params;1"].createInstance(Ci.nsICommandParams);
}
catch(e) { dump("error thrown in newCommandParams: "+e+"\n"); }
return null;
}
/************* General editing command utilities ***************/
function GetDocumentTitle()
@@ -385,17 +385,17 @@ function SetElementEnabled(element, doEn
}
}
/************* Services / Prefs ***************/
function GetFileProtocolHandler()
{
let handler = Services.io.getProtocolHandler("file");
- return handler.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
+ return handler.QueryInterface(Ci.nsIFileProtocolHandler);
}
function GetStringPref(name)
{
try {
return Services.prefs.getStringPref(name);
} catch (e) {}
return "";
@@ -414,36 +414,36 @@ function SetFilePickerDirectory(filePick
{
if (filePicker)
{
try {
// Save current directory so we can reset it in SaveFilePickerDirectory
gFilePickerDirectory = filePicker.displayDirectory;
let location = Services.prefs.getComplexValue("editor.lastFileLocation."+fileType,
- Components.interfaces.nsIFile);
+ Ci.nsIFile);
if (location)
filePicker.displayDirectory = location;
}
catch(e) {}
}
}
// Save the directory of the selected file to prefs
function SaveFilePickerDirectory(filePicker, fileType)
{
if (filePicker && filePicker.file)
{
try {
var fileDir;
if (filePicker.file.parent)
- fileDir = filePicker.file.parent.QueryInterface(Components.interfaces.nsIFile);
+ fileDir = filePicker.file.parent.QueryInterface(Ci.nsIFile);
Services.prefs.setComplexValue("editor.lastFileLocation." + fileType,
- Components.interfaces.nsIFile, fileDir);
+ Ci.nsIFile, fileDir);
Services.prefs.savePrefFile(null);
} catch (e) {}
}
// Restore the directory used before SetFilePickerDirectory was called;
// This reduces interference with Browser and other module directory defaults
if (gFilePickerDirectory)
@@ -723,17 +723,17 @@ function GetFilename(urlspec)
return "";
var filename;
try {
let uri = Services.io.newURI(urlspec);
if (uri)
{
- let url = uri.QueryInterface(Components.interfaces.nsIURL);
+ let url = uri.QueryInterface(Ci.nsIURL);
if (url)
filename = url.fileName;
}
} catch (e) {}
return filename ? filename : "";
}
--- a/editor/ui/composer/content/pref-editing.js
+++ b/editor/ui/composer/content/pref-editing.js
@@ -153,19 +153,19 @@ function SetBgAndFgColors(aSysPrefEnable
{
SetColorPreview("normalText", Services.prefs.getCharPref("browser.display.foreground_color"));
SetColorPreview("ColorPreview", Services.prefs.getCharPref("browser.display.background_color"));
}
}
function ChooseImageFile()
{
- const nsIFilePicker = Components.interfaces.nsIFilePicker;
- var fp = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
+ const nsIFilePicker = Ci.nsIFilePicker;
+ var fp = Cc["@mozilla.org/filepicker;1"]
+ .createInstance(nsIFilePicker);
var editorBundle = document.getElementById("bundle_editor");
var title = editorBundle.getString("SelectImageFile");
fp.init(window, title, nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterImages);
fp.open(rv => {
if (rv != nsIFilePicker.returnOK || !fp.file) {
return;
}
--- a/editor/ui/composer/content/publishprefs.js
+++ b/editor/ui/composer/content/publishprefs.js
@@ -837,18 +837,18 @@ function SavePassword(publishData)
Services.logins.removeLogin(logins[i]);
break;
}
}
// If SavePassword is true, add new password.
if (publishData.savePassword)
{
- let authInfo = Components.classes["@mozilla.org/login-manager/loginInfo;1"]
- .createInstance(Components.interfaces.nsILoginInfo);
+ let authInfo = Cc["@mozilla.org/login-manager/loginInfo;1"]
+ .createInstance(Ci.nsILoginInfo);
authInfo.init(url, null, url, publishData.username, publishData.password,
"", "");
Services.logins.addLogin(authInfo);
}
return true;
}
--- a/editor/ui/dialogs/content/EdDialogCommon.js
+++ b/editor/ui/dialogs/content/EdDialogCommon.js
@@ -380,24 +380,24 @@ function onMoreFewer()
}
function SwitchToValidatePanel()
{
// no default implementation
// Only EdTableProps.js currently implements this
}
-const nsIFilePicker = Components.interfaces.nsIFilePicker;
+const nsIFilePicker = Ci.nsIFilePicker;
/**
* @return {Promise} URL spec of the file chosen, or null
*/
function GetLocalFileURL(filterType)
{
- var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+ var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
var fileType = "html";
if (filterType == "img")
{
fp.init(window, GetString("SelectImageFile"), nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterImages);
fileType = "image";
}
@@ -569,17 +569,17 @@ function SetRelativeCheckbox(checkbox)
if (!checkbox) {
checkbox = document.getElementById("MakeRelativeCheckbox");
if (!checkbox)
return;
}
var editor = GetCurrentEditor();
// Mail never allows relative URLs, so hide the checkbox
- if (editor && (editor.flags & Components.interfaces.nsIPlaintextEditor.eEditorMailMask))
+ if (editor && (editor.flags & Ci.nsIPlaintextEditor.eEditorMailMask))
{
checkbox.collapsed = true;
return;
}
var input = document.getElementById(checkbox.getAttribute("for"));
if (!input)
return;
@@ -951,17 +951,17 @@ function FillLinkMenulist(linkMenulist,
});
for (i = 0; i < anchorList.length; i++)
createMenuItem(menupopup,anchorList[i].anchor);
}
else
{
// Don't bother with named anchors in Mail.
- if (editor && (editor.flags & Components.interfaces.nsIPlaintextEditor.eEditorMailMask))
+ if (editor && (editor.flags & Ci.nsIPlaintextEditor.eEditorMailMask))
{
menupopup.remove();
linkMenulist.removeAttribute("enablehistory");
return;
}
var item = createMenuItem(menupopup, GetString("NoNamedAnchorsOrHeadings"));
item.setAttribute("disabled", "true");
}
--- a/editor/ui/dialogs/content/EdImageOverlay.js
+++ b/editor/ui/dialogs/content/EdImageOverlay.js
@@ -295,18 +295,18 @@ function LoadPreviewImage()
// We must have an absolute URL to preview it or remove it from the cache
imageSrc = MakeAbsoluteUrl(imageSrc);
if (GetScheme(imageSrc))
{
let uri = Services.io.newURI(imageSrc);
if (uri)
{
- let imgCache = Components.classes["@mozilla.org/image/cache;1"]
- .getService(Components.interfaces.imgICache);
+ let imgCache = Cc["@mozilla.org/image/cache;1"]
+ .getService(Ci.imgICache);
// This returns error if image wasn't in the cache; ignore that
imgCache.removeEntry(uri);
}
}
} catch(e) {}
if (gDialog.PreviewImage)
@@ -473,17 +473,17 @@ function ValidateImage()
}
else
{
var checkbox = document.getElementById("MakeRelativeCheckbox");
try
{
if (checkbox && !checkbox.checked)
{
- src = Services.uriFixup.createFixupURI(src, Components.interfaces.nsIURIFixup.FIXUP_FLAG_NONE).spec;
+ src = Services.uriFixup.createFixupURI(src, Ci.nsIURIFixup.FIXUP_FLAG_NONE).spec;
}
} catch (e) { }
globalElement.setAttribute("src", src);
}
let title = gDialog.titleInput.value.trim();
if (title)
--- a/editor/ui/dialogs/content/EdInsertMath.js
+++ b/editor/ui/dialogs/content/EdInsertMath.js
@@ -25,19 +25,19 @@ function Startup()
// Set initial focus
gDialog.input.focus();
// Load TeXZilla
// TeXZilla.js contains non-ASCII characters and explicitly sets
// window.TeXZilla, so we have to specify the charset parameter but don't
// need to worry about the targetObj parameter.
- Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
- .getService(Components.interfaces.mozIJSSubScriptLoader)
- .loadSubScript("chrome://editor/content/TeXZilla.js", {}, "UTF-8");
+ Cc["@mozilla.org/moz/jssubscript-loader;1"]
+ .getService(Ci.mozIJSSubScriptLoader)
+ .loadSubScript("chrome://editor/content/TeXZilla.js", {}, "UTF-8");
// Verify if the selection is on a <math> and initialize the dialog.
gDialog.oldMath = editor.getElementOrParentByTagName("math", null);
if (gDialog.oldMath) {
// When these attributes are absent or invalid, they default to "inline" and "ltr" respectively.
gDialog.mode.selectedIndex = gDialog.oldMath.getAttribute("display") == "block" ? 1 : 0;
gDialog.direction.selectedIndex = gDialog.oldMath.getAttribute("dir") == "rtl" ? 1 : 0;
gDialog.input.value = TeXZilla.getTeXSource(gDialog.oldMath);
@@ -105,17 +105,17 @@ function Startup()
}
function insertLaTeXCommand(aButton)
{
gDialog.input.focus();
// For a single math symbol, just use the insertText command.
if (aButton.label) {
- gDialog.input.editor.QueryInterface(Components.interfaces.nsIPlaintextEditor).insertText(aButton.label);
+ gDialog.input.editor.QueryInterface(Ci.nsIPlaintextEditor).insertText(aButton.label);
return;
}
// Otherwise, it's a LaTeX command with at least one argument...
var latex = TeXZilla.getTeXSource(aButton.firstChild);
var selectionStart = gDialog.input.selectionStart;
var selectionEnd = gDialog.input.selectionEnd;
@@ -135,17 +135,17 @@ function insertLaTeXCommand(aButton)
latexNewStart = 0;
latexNewEnd = latex.length;
} else {
// Otherwise, select the dots representing the next argument.
latexNewEnd = latexNewStart + 1;
}
// Update the input text and selection.
- gDialog.input.editor.QueryInterface(Components.interfaces.nsIPlaintextEditor).insertText(latex);
+ gDialog.input.editor.QueryInterface(Ci.nsIPlaintextEditor).insertText(latex);
gDialog.input.setSelectionRange(selectionStart + latexNewStart,
selectionStart + latexNewEnd);
updateMath();
}
function createCommandPanel(aCommandPanelList)
{
--- a/editor/ui/dialogs/content/EdInsertTable.js
+++ b/editor/ui/dialogs/content/EdInsertTable.js
@@ -36,17 +36,17 @@ function Startup()
gDialog.borderInput = document.getElementById("borderInput");
gDialog.widthPixelOrPercentMenulist = document.getElementById("widthPixelOrPercentMenulist");
gDialog.OkButton = document.documentElement.getButton("accept");
// Make a copy to use for AdvancedEdit
globalElement = gTableElement.cloneNode(false);
try {
if (Services.prefs.getBoolPref("editor.use_css") && IsHTMLEditor()
- && !(gActiveEditor.flags & Components.interfaces.nsIPlaintextEditor.eEditorMailMask))
+ && !(gActiveEditor.flags & Ci.nsIPlaintextEditor.eEditorMailMask))
{
// only for Composer and not for htmlmail
globalElement.setAttribute("style", "text-align: left;");
}
} catch (e) {}
// Initialize all widgets with image attributes
InitDialog();
--- a/editor/ui/dialogs/content/EdLinkChecker.js
+++ b/editor/ui/dialogs/content/EdLinkChecker.js
@@ -14,17 +14,17 @@ var gLinkCheckTimerID = 0;
var gRequestObserver =
{
// urichecker requires that we have an OnStartRequest even tho it's a nop.
onStartRequest: function(request, ctxt) { },
// onStopRequest is where we really handle the status.
onStopRequest: function(request, ctxt, status)
{
- var linkChecker = request.QueryInterface(Components.interfaces.nsIURIChecker);
+ var linkChecker = request.QueryInterface(Ci.nsIURIChecker);
if (linkChecker)
{
gNumLinksCalledBack++;
linkChecker.status = status;
for (var i = 0; i < gNumLinksCalledBack; i++)
{
if (linkChecker == gLinksBeingChecked[i])
gLinksBeingChecked[i].status = status;
@@ -65,40 +65,40 @@ function Startup()
// Set window location relative to parent window (based on persisted attributes)
SetWindowLocation();
// Loop over the nodes that have links:
for (let i = 0; i < objects.length; i++)
{
let refobj = objects.queryElementAt(gNumLinksToCheck,
- Components.interfaces.nsIURIRefObject);
+ Ci.nsIURIRefObject);
// Loop over the links in this node:
if (refobj)
{
try {
var uri;
while ((uri = refobj.GetNextURI()))
{
// Use the real class in netlib:
// Note that there may be more than one link per refobj
gURIRefObjects[gNumLinksToCheck] = refobj;
// Make a new nsIURIChecker
gLinksBeingChecked[gNumLinksToCheck]
- = Components.classes["@mozilla.org/network/urichecker;1"]
+ = Cc["@mozilla.org/network/urichecker;1"]
.createInstance()
- .QueryInterface(Components.interfaces.nsIURIChecker);
+ .QueryInterface(Ci.nsIURIChecker);
// XXX uri creation needs to be localized
gLinksBeingChecked[gNumLinksToCheck].init(GetIOService().newURI(uri));
gLinksBeingChecked[gNumLinksToCheck].asyncCheck(gRequestObserver, null);
// Add item
let linkChecker = gLinksBeingChecked[gNumLinksToCheck]
- .QueryInterface(Components.interfaces.nsIURIChecker);
+ .QueryInterface(Ci.nsIURIChecker);
SetItemStatus(linkChecker.name, "busy");
dump(" *** Linkcount = "+gNumLinksToCheck+"\n");
gNumLinksToCheck++;
}
} catch (e) { dump (" *** EXCEPTION\n"); }
}
}
// Done with the loop, now we can be prepared for the finish:
@@ -115,17 +115,17 @@ function LinkCheckTimeOut()
if (gNumLinksToCheck <= 0)
return;
gLinkCheckTimerID = 0;
gNumLinksToCheck = 0;
gStartedAllChecks = false;
for (var i=0; i < gLinksBeingChecked.length; i++)
{
- var linkChecker = gLinksBeingChecked[i].QueryInterface(Components.interfaces.nsIURIChecker);
+ var linkChecker = gLinksBeingChecked[i].QueryInterface(Ci.nsIURIChecker);
// nsIURIChecker status values:
// NS_BINDING_SUCCEEDED link is valid
// NS_BINDING_FAILED link is invalid (gave an error)
// NS_BINDING_ABORTED timed out, or cancelled
switch (linkChecker.status)
{
case 0: // NS_BINDING_SUCCEEDED
SetItemStatus(linkChecker.name, "done");
--- a/editor/ui/dialogs/content/EdReplace.js
+++ b/editor/ui/dialogs/content/EdReplace.js
@@ -59,18 +59,18 @@ function onLoad()
return;
}
// Get the nsIWebBrowserFind service:
gFindInst = editorElement.webBrowserFind;
try {
// get the find service, which stores global find state
- gFindService = Components.classes["@mozilla.org/find/find_service;1"]
- .getService(Components.interfaces.nsIFindService);
+ gFindService = Cc["@mozilla.org/find/find_service;1"]
+ .getService(Ci.nsIFindService);
} catch(e) { dump("No find service!\n"); gFindService = 0; }
// Init gReplaceDialog.
initDialogObject();
// Change "OK" to "Find".
//dialog.find.label = document.getElementById("fBLT").getAttribute("label");
@@ -226,17 +226,17 @@ function onReplaceAll()
return;
var findStr = gReplaceDialog.findInput.value;
var repStr = gReplaceDialog.replaceInput.value;
// Transfer dialog contents to the find service.
saveFindData();
- var finder = Components.classes["@mozilla.org/embedcomp/rangefind;1"].createInstance().QueryInterface(Components.interfaces.nsIFind);
+ var finder = Cc["@mozilla.org/embedcomp/rangefind;1"].createInstance().QueryInterface(Ci.nsIFind);
finder.caseSensitive = gReplaceDialog.caseSensitive.checked;
finder.findBackwards = gReplaceDialog.searchBackwards.checked;
// We want the whole operation to be undoable in one swell foop,
// so start a transaction:
gEditor.beginTransaction();
@@ -247,17 +247,17 @@ function onReplaceAll()
var selection = gEditor.selection;
var selecRange;
if (selection.rangeCount > 0)
selecRange = selection.getRangeAt(0);
var origRange = selecRange.cloneRange();
// We'll need a range for the whole document:
var wholeDocRange = gEditor.document.createRange();
- var rootNode = gEditor.rootElement.QueryInterface(Components.interfaces.nsIDOMNode);
+ var rootNode = gEditor.rootElement.QueryInterface(Ci.nsIDOMNode);
wholeDocRange.selectNodeContents(rootNode);
// And start and end points:
var endPt = gEditor.document.createRange();
if (gReplaceDialog.searchBackwards.checked)
{
endPt.setStart(wholeDocRange.startContainer, wholeDocRange.startOffset);
--- a/editor/ui/dialogs/content/EdSelectProps.js
+++ b/editor/ui/dialogs/content/EdSelectProps.js
@@ -480,22 +480,22 @@ function Startup()
UpdateSelectMultiple();
// Define a custom view for the tree
treeBoxObject = gDialog.tree.treeBoxObject;
treeBoxObject.view = {
QueryInterface : function QueryInterface(aIID)
{
- if (aIID.equals(Components.interfaces.nsITreeView) ||
- aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
- aIID.equals(Components.interfaces.nsISupports))
+ if (aIID.equals(Ci.nsITreeView) ||
+ aIID.equals(Ci.nsISupportsWeakReference) ||
+ aIID.equals(Ci.nsISupports))
return this;
- throw Components.results.NS_ERROR_NO_INTERFACE;
+ throw Cr.NS_ERROR_NO_INTERFACE;
},
// useful for debugging
get wrappedJSObject() { return this; },
get rowCount() { return itemArray.length; },
get selection() { return treeSelection; },
set selection(selection) { return treeSelection = selection; },
getRowProperties: function getRowProperties(index) { return ""; },
// could have used a wrapper for this
--- a/editor/ui/dialogs/content/EdSnapToGrid.js
+++ b/editor/ui/dialogs/content/EdSnapToGrid.js
@@ -9,17 +9,17 @@ function Startup()
{
gEditor = GetCurrentEditor();
if (!gEditor)
{
window.close();
return;
}
- gEditor instanceof Components.interfaces.nsIHTMLAbsPosEditor;
+ gEditor instanceof Ci.nsIHTMLAbsPosEditor;
gDialog.enableSnapToGrid = document.getElementById("enableSnapToGrid");
gDialog.sizeInput = document.getElementById("size");
gDialog.sizeLabel = document.getElementById("sizeLabel");
gDialog.unitLabel = document.getElementById("unitLabel");
// Initialize control values based on existing attributes
InitDialog()
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -18,17 +18,17 @@ function Startup()
var editor = GetCurrentEditor();
if (!editor)
{
window.close();
return;
}
// Get the spellChecker shell
- gSpellChecker = Components.classes['@mozilla.org/editor/editorspellchecker;1'].createInstance(Components.interfaces.nsIEditorSpellCheck);
+ gSpellChecker = Cc['@mozilla.org/editor/editorspellchecker;1'].createInstance(Ci.nsIEditorSpellCheck);
if (!gSpellChecker)
{
dump("SpellChecker not found!!!\n");
window.close();
return;
}
// Start the spell checker module.
@@ -38,17 +38,17 @@ function Startup()
var skipBlockQuotes = window.arguments[1];
var enableSelectionChecking = window.arguments[2];
if (skipBlockQuotes)
filterContractId = "@mozilla.org/editor/txtsrvfiltermail;1";
else
filterContractId = "@mozilla.org/editor/txtsrvfilter;1";
- gSpellChecker.setFilter(Components.classes[filterContractId].createInstance(Components.interfaces.nsITextServicesFilter));
+ gSpellChecker.setFilter(Cc[filterContractId].createInstance(Ci.nsITextServicesFilter));
gSpellChecker.InitSpellChecker(editor, enableSelectionChecking, spellCheckStarted);
}
catch(ex) {
dump("*** Exception error: InitSpellChecker\n");
window.close();
return;
}
@@ -399,22 +399,22 @@ function Recheck()
SetWidgetsForMisspelledWord();
}
//TODO: Should we bother to add a "Recheck" method to interface?
try {
recheckLanguage = gSpellChecker.GetCurrentDictionary();
gSpellChecker.UninitSpellChecker();
// Clear the ignore all list.
- Components.classes["@mozilla.org/spellchecker/personaldictionary;1"]
- .getService(Components.interfaces.mozIPersonalDictionary)
- .endSession();
+ Cc["@mozilla.org/spellchecker/personaldictionary;1"]
+ .getService(Ci.mozIPersonalDictionary)
+ .endSession();
gSpellChecker.InitSpellChecker(GetCurrentEditor(), false, finishRecheck);
} catch(ex) {
- Components.utils.reportError(ex);
+ Cu.reportError(ex);
}
}
function FillSuggestedList(misspelledWord)
{
var list = gDialog.SuggestedList;
// Clear the current contents of the list
--- a/editor/ui/nsComposerCmdLineHandler.js
+++ b/editor/ui/nsComposerCmdLineHandler.js
@@ -1,32 +1,32 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
-const nsISupportsString = Components.interfaces.nsISupportsString;
-const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
+const nsICommandLineHandler = Ci.nsICommandLineHandler;
+const nsISupportsString = Ci.nsISupportsString;
+const nsIWindowWatcher = Ci.nsIWindowWatcher;
function nsComposerCmdLineHandler() {}
nsComposerCmdLineHandler.prototype = {
get wrappedJSObject() {
return this;
},
/* nsISupports */
QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler]),
/* nsICommandLineHandler */
handle : function handle(cmdLine) {
- var args = Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(nsISupportsString);
+ var args = Cc["@mozilla.org/supports-string;1"]
+ .createInstance(nsISupportsString);
try {
var uristr = cmdLine.handleFlagWithParam("edit", false);
if (uristr == null) {
// Try the editor flag (used for general.startup.* prefs)
uristr = cmdLine.handleFlagWithParam("editor", false);
if (uristr == null)
return;
}
--- a/im/components/contentHandler.js
+++ b/im/components/contentHandler.js
@@ -14,17 +14,17 @@ var NS_ERROR_WONT_HANDLE_CONTENT = 0x805
function contentHandler() {
}
contentHandler.prototype = {
classID: Components.ID("{fda46332-1b03-4940-a30c-0997445d8e34}"),
_xpcom_factory: {
createInstance: function ch_factory_ci(outer, iid) {
if (outer)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
+ throw Cr.NS_ERROR_NO_AGGREGATION;
return gContentHandler.QueryInterface(iid);
}
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler]),
// nsIContentHandler
@@ -51,17 +51,17 @@ contentHandler.prototype = {
.getService(Ci.nsIExternalProtocolService)
.loadURI(aRequest.URI);
aRequest.cancel(Cr.NS_BINDING_ABORTED);
},
// nsIFactory
createInstance: function ch_CI(outer, iid) {
if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
+ throw Cr.NS_ERROR_NO_AGGREGATION;
return this.QueryInterface(iid);
},
lockFactory: function ch_lock(lock) {
// No-op.
}
};
--- a/im/components/devtools/content/webconsole-overlay.xul
+++ b/im/components/devtools/content/webconsole-overlay.xul
@@ -11,15 +11,15 @@
<!-- Workaround since devtools hardcodes navigator:browser, which makes
browserWindow null, which means it falls back to using the
webconsole.xul window to look for gViewSourceUtils. -->
<script type="application/javascript" src="chrome://global/content/viewSourceUtils.js"/>
<script type="application/javascript"><![CDATA[
var {classes: Cc, interfaces: Ci} = Components;
function openUILinkIn(url) {
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Ci.nsIExternalProtocolService)
- .loadURI(ios.newURI(url), window);
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .loadURI(ios.newURI(url), window);
}
]]></script>
</window>
</overlay>
--- a/im/components/ibCommandLineHandler.js
+++ b/im/components/ibCommandLineHandler.js
@@ -31,18 +31,18 @@ ibCommandLineHandler.prototype = {
#ifdef XP_MACOSX
else {
// If we have no reason to show the account manager and the
// buddy list is not shown because of the -silent flag, we
// should avoid an early exit.
// The code in nsAppStartup::Run won't start the event loop if
// we don't have at least one window or one call to
// enterLastWindowClosingSurvivalArea.
- let as = Components.classes["@mozilla.org/toolkit/app-startup;1"]
- .getService(Ci.nsIAppStartup);
+ let as = Cc["@mozilla.org/toolkit/app-startup;1"]
+ .getService(Ci.nsIAppStartup);
as.enterLastWindowClosingSurvivalArea();
// We can exitLastWindowClosingSurvivalArea as soon as the
// load of our application provided hiddenWindow has begun.
executeSoon(function() { as.exitLastWindowClosingSurvivalArea(); });
}
#endif
}
},
--- a/im/components/mintrayr/content/mintrayr.js
+++ b/im/components/mintrayr/content/mintrayr.js
@@ -30,22 +30,22 @@ var gMinTrayR = {
let docElt = window.document.documentElement;
if (docElt.hasAttribute("storeScreenX"))
window.moveTo(docElt.getAttribute("storeScreenX"),
docElt.getAttribute("storeScreenY"));
#endif
#endif
this.trayService =
- Components.classes['@tn123.ath.cx/trayservice;1']
- .getService(Components.interfaces.trayITrayService);
+ Cc['@tn123.ath.cx/trayservice;1']
+ .getService(Ci.trayITrayService);
this.trayService.watchMinimize(window);
this._prefs = Services.prefs.getBranch("extensions.mintrayr.")
- .QueryInterface(Components.interfaces.nsIPrefBranch);
+ .QueryInterface(Ci.nsIPrefBranch);
this._prefs.addObserver("alwaysShowTrayIcon", this);
// Add a listener to minimize the window on startup once it has been
// fully created if the corresponding pref is set.
if (this._prefs.getBoolPref("startMinimized")) {
window.addEventListener("focus", () => {
if (gMinTrayR._prefs.getIntPref("minimizeon"))
gMinTrayR.minimize();
--- a/im/content/aboutDialog.xul
+++ b/im/content/aboutDialog.xul
@@ -34,31 +34,31 @@
#include menus.xul.inc
#endif
<script type="application/javascript">
<![CDATA[
var gSelectedPage;
function onLoad() {
- var xai = Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Components.interfaces.nsIXULAppInfo);
+ var xai = Cc["@mozilla.org/xre/app-info;1"]
+ .getService(Ci.nsIXULAppInfo);
var versionField = document.getElementById("versionField");
versionField.value = versionField.value + xai.version
+ ' (' + xai.appBuildID + ')';
versionField = document.getElementById("geckoVersionField");
versionField.value = versionField.value + xai.platformVersion
+ ' (' + xai.platformBuildID + ')';
versionField = document.getElementById("libpurpleVersionField");
if ("@instantbird.org/libpurple/core;1" in Components.classes) {
- var pcs = Components.classes["@instantbird.org/libpurple/core;1"]
- .getService(Components.interfaces.purpleICoreService);
+ var pcs = Cc["@instantbird.org/libpurple/core;1"]
+ .getService(Ci.purpleICoreService);
versionField.value = versionField.value + pcs.version;
}
else {
versionField.hidden = true;
}
versionField = document.getElementById("userAgentField");
versionField.value = navigator.userAgent;
--- a/im/content/aboutPanel.xml
+++ b/im/content/aboutPanel.xml
@@ -65,18 +65,18 @@
let win = this.browser.contentWindow;
let open = win.open;
win.open = function(aUrl) {
let uri = Services.io.newURI(aUrl);
if (!uri.schemeIs("http") && !uri.schemeIs("https")) {
open.apply(this, arguments);
}
else {
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService).loadURI(uri);
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService).loadURI(uri);
}
}
]]>
</constructor>
</implementation>
<handlers>
<handler event="click">
@@ -110,16 +110,16 @@
return;
}
// If we couldn't add a new tab, load the page in this one.
this.showAboutPage(url);
return;
}
// Otherwise open in default browser.
// loadURI can throw if the default browser is misconfigured.
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService)
- .loadURI(Services.io.newURI(url));
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .loadURI(Services.io.newURI(url));
]]>
</handler>
</handlers>
</binding>
</bindings>
--- a/im/content/accountWizard.js
+++ b/im/content/accountWizard.js
@@ -177,18 +177,18 @@ var accountWizard = {
/* FIXME
document.getElementById("newMailNotification").hidden =
!this.proto.newMailNotification;
*/
this.populateProtoSpecificBox();
let proxyVisible = this.proto.usePurpleProxy;
if (proxyVisible) {
- this.proxy = Components.classes["@instantbird.org/purple/proxyinfo;1"]
- .createInstance(Ci.purpleIProxyInfo);
+ this.proxy = Cc["@instantbird.org/purple/proxyinfo;1"]
+ .createInstance(Ci.purpleIProxyInfo);
this.proxy.type = Ci.purpleIProxyInfo.useGlobal;
this.displayProxyDescription();
}
document.getElementById("proxyGroupbox").hidden = !proxyVisible;
let alias = document.getElementById("alias");
alias.focus();
},
@@ -453,35 +453,35 @@ var accountWizard = {
/* Check for correctness and set URL for the "Get more protocols..."-link
* Stripped down code from preferences/themes.js
*/
setGetMoreProtocols: function (){
let prefURL = PREF_EXTENSIONS_GETMOREPROTOCOLSURL;
let getMore = document.getElementById("getMoreProtocols");
let showGetMore = false;
- const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
+ const nsIPrefBranch = Ci.nsIPrefBranch;
if (Services.prefs.getPrefType(prefURL) != nsIPrefBranch.PREF_INVALID) {
try {
- let getMoreURL = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
- .getService(Components.interfaces.nsIURLFormatter)
- .formatURLPref(prefURL);
+ let getMoreURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
+ .getService(Ci.nsIURLFormatter)
+ .formatURLPref(prefURL);
getMore.setAttribute("getMoreURL", getMoreURL);
showGetMore = getMoreURL != "about:blank";
}
catch (e) { }
}
getMore.hidden = !showGetMore;
},
openURL: function (aURL) {
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService)
- .loadURI(Services.io.newURI(aURL));
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .loadURI(Services.io.newURI(aURL));
},
advanceTopProtocolPage: function() {
let selectedProtocol = document.getElementById("topprotolist").selectedItem;
if (!selectedProtocol || selectedProtocol.id == "otherListItem")
return true;
accountWizard.selectProtocol();
document.getElementById("accountWizard").goTo("accountusername");
--- a/im/content/blist.js
+++ b/im/content/blist.js
@@ -600,19 +600,19 @@ var buddyList = {
default:
if (aEvent.charCode == aEvent.DOM_VK_SPACE)
this.chooseUserIcon();
break;
}
},
chooseUserIcon: function bl_chooseUserIcon() {
- const nsIFilePicker = Components.interfaces.nsIFilePicker;
- let fp = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
+ const nsIFilePicker = Ci.nsIFilePicker;
+ let fp = Cc["@mozilla.org/filepicker;1"]
+ .createInstance(nsIFilePicker);
let bundle = document.getElementById("instantbirdBundle");
fp.init(window, bundle.getString("userIconFilePickerTitle"),
nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterImages);
fp.open(rv => {
if (rv != nsIFilePicker.returnOK || !fp.file) {
return;
}
--- a/im/content/contact.xml
+++ b/im/content/contact.xml
@@ -449,19 +449,19 @@
</implementation>
<handlers>
<handler event="blur">
<![CDATA[
if (!this.hasAttribute("aliasing"))
return;
let win =
- Components.classes["@mozilla.org/focus-manager;1"]
- .getService(Components.interfaces.nsIFocusManager)
- .activeWindow;
+ Cc["@mozilla.org/focus-manager;1"]
+ .getService(Ci.nsIFocusManager)
+ .activeWindow;
if (win == document.defaultView)
finishAliasing(true);
]]>
</handler>
<handler event="mousedown">
<![CDATA[
if (!this.hasAttribute("aliasing") && canOpenConversation() &&
--- a/im/content/conversation.xml
+++ b/im/content/conversation.xml
@@ -312,29 +312,29 @@
}
}
if (!account.connected) {
let errMsg;
if (Services.io.offline)
errMsg = this.bundle.GetStringFromName("networkOffline");
else if (account.statusInfo.statusType ==
- Components.interfaces.imIStatusInfo.STATUS_OFFLINE)
+ Ci.imIStatusInfo.STATUS_OFFLINE)
errMsg = this.bundle.GetStringFromName("statusOffline");
else {
errMsg = this.bundle.formatStringFromName("accountDisconnected",
[account.protocol.name, account.name], 2);
}
this._conv.systemMessage(errMsg, true);
return;
}
- let msg = Components.classes["@mozilla.org/txttohtmlconv;1"]
- .getService(Ci.mozITXTToHTMLConv)
- .scanTXT(aMsg, 0);
+ let msg = Cc["@mozilla.org/txttohtmlconv;1"]
+ .getService(Ci.mozITXTToHTMLConv)
+ .scanTXT(aMsg, 0);
if (account.HTMLEnabled) {
msg = msg.replace(/\n/g, "<br/>");
if (Services.prefs.getBoolPref("messenger.conversations.sendFormat")) {
let style = MessageFormat.getMessageStyle();
let proto = this._conv.account.protocol.id;
if (proto == "prpl-msn") {
if ("color" in style)
@@ -1031,32 +1031,32 @@
if (accelKeyPressed ||
!Services.prefs.getBoolPref("accessibility.typeaheadfind"))
document.getBindingParent(this).editor.focus();
// Returns for Ctrl+V
if (accelKeyPressed)
return;
- const masks = Components.interfaces.nsIDOMNSEvent;
+ const masks = Ci.nsIDOMNSEvent;
var modifiers = 0;
if (event.shiftKey)
modifiers |= masks.SHIFT_MASK;
if (event.ctrlKey)
modifiers |= masks.CONTROL_MASK;
if (event.altKey)
modifiers |= masks.ALT_MASK;
if (event.metaKey)
modifiers |= masks.META_MASK;
if (event.accelKey)
modifiers |= isMac ? masks.META_MASK : masks.CONTROL_MASK;
// resend the event
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils)
+ window.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils)
.sendKeyEvent(event.type, event.keyCode, event.charCode, modifiers);
]]>
</body>
</method>
<method name="browserDblClick">
<parameter name="event"/>
<body>
--- a/im/content/credits.xhtml
+++ b/im/content/credits.xhtml
@@ -157,21 +157,21 @@
}
function openContributors(aEvent)
{
// Always prevent the default action even if loading throws, to
// avoid replacing the current document with an external page.
aEvent.preventDefault();
- var ioService = Components.classes["@mozilla.org/network/io-service;1"].
- getService(Components.interfaces.nsIIOService);
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService)
- .loadURI(ioService.newURI(aEvent.target.href));
+ var ioService = Cc["@mozilla.org/network/io-service;1"].
+ getService(Ci.nsIIOService);
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .loadURI(ioService.newURI(aEvent.target.href));
}
]]>
</script>
</head>
<body onload="init();" onunload="uninit();">
<div id="titleBox">
<img src="chrome://branding/content/about-credits.png" />
--- a/im/content/debug/debug.js
+++ b/im/content/debug/debug.js
@@ -14,33 +14,33 @@ var debug = {
"chrome,resizable,centerscreen");
},
inspector: function debug_inspector() {
inspectDOMDocument(document);
},
garbageCollect: function debug_garbageCollect() {
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils)
+ window.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils)
.garbageCollect();
},
forceOnline: function debug_forceOnline() {
var ios = Services.io;
ios.manageOfflineStatus = false;
ios.offline = false;
},
load: function debug_load() {
setTimeout(function() {
// Load the Window DataSource so that browser windows opened subsequent to DOM
// Inspector show up in the DOM Inspector's window list.
- var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
- .getService(Components.interfaces.nsIWindowDataSource);
+ var windowDS = Cc["@mozilla.org/rdf/datasource;1?name=window-mediator"]
+ .getService(Ci.nsIWindowDataSource);
}, 0);
}
};
window.addEventListener("load", debug.load);
function debug_enumerateProtocols()
{
--- a/im/content/debug/fake/fake.js
+++ b/im/content/debug/fake/fake.js
@@ -180,19 +180,19 @@ var ib_icon_url = 'data:image/png;base64
'eH6CYflxyvPifLy8jtimLYPfiQOGoUvDozseQ7e9Xl16PIbyeg3l83lUVpZf5OeHjLy8kDc3N6jn5ATI' +
'zg4wcA2SkxOgubmb66576sA7kfjwf+n/Bosrq4txs09LgVKEKHT8BeXSEyqWRihPegI5Sg8GpeH3CWU7' +
'worHNDsSFna0RzcjnVqip8ljRjp0x4p4LLPfH491BWKRsCYdP5B9hJqTamualqfrIhfIUYosKWVISpV+' +
'Rez3e7asjZmT/+V/nEwSIXATMsuAAiAXCAJ+wMOAS24laxQ3YNEFtAEHWxsbTP7BMkMIDwNkiQ1K7f23' +
'EHCkkiTFwE231knmjgJ28gD2byn/MQL+fyn/6/89/v8AG+f1CR8WcKcAAAAASUVORK5CYII=';
var fake = {
load: function f_load() {
- if (!Components.classes["@mozilla.org/process/environment;1"]
- .getService(Components.interfaces.nsIEnvironment)
- .get("FAKE"))
+ if (!Cc["@mozilla.org/process/environment;1"]
+ .getService(Ci.nsIEnvironment)
+ .get("FAKE"))
return;
dump("Fake load\n");
setTimeout(function() {
fake.fakeIt();
}, 1000);
},
@@ -209,18 +209,18 @@ var fake = {
new Account("tom.smith@hotmail.com", "prpl-msn"),
new Account("tom.smith@gmail.com/instantbird",
"prpl-jabber"),
new Account("tom.smith@yahoo.com", "prpl-yahoo"),
new Account("tom@irc.mozilla.org", "prpl-irc")];
for (let account of this.accounts)
Services.obs.notifyObservers(account, "account-added");
- var win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
- .getService(Components.interfaces.nsIWindowMediator)
+ var win = Cc["@mozilla.org/appshell/window-mediator;1"]
+ .getService(Ci.nsIWindowMediator)
.getMostRecentWindow("Messenger:accountWizard");
if (win)
win.close();
this.groups = [
"Contacts",
"Friends",
"Colleagues"
@@ -310,18 +310,18 @@ var fake = {
Services.core.globalUserStatus.displayName = "Tom Smith";
// Ugly :-(
document.getElementById("userIcon").src = ib_icon_url;
},
deleteAccounts: function f_deleteAccounts() {
if (!Services.accounts.getAccounts().hasMoreElements())
return;
- var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
+ var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"]
+ .getService(Ci.nsIPromptService);
if (!prompts.confirm(window, "Are you sure you want to delete all accounts?",
"You are about to delete your accounts. Are you sure?"))
throw "user aborted the operation";
for (let acc of getIter(Services.accounts.getAccounts()))
Services.accounts.deleteAccount(acc.id);
}
};
--- a/im/content/debugLogPanel.xml
+++ b/im/content/debugLogPanel.xml
@@ -87,19 +87,19 @@
this.findbar.browser = this.browser;
]]>
</body>
</method>
<method name="copyDebugLog">
<body>
<![CDATA[
- Components.classes["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Components.interfaces.nsIClipboardHelper)
- .copyString(this.browser.contentDocument.body.textContent);
+ Cc["@mozilla.org/widget/clipboardhelper;1"]
+ .getService(Ci.nsIClipboardHelper)
+ .copyString(this.browser.contentDocument.body.textContent);
]]>
</body>
</method>
<method name="showDebugLog">
<body>
<![CDATA[
let accId = this.accountList.selectedItem.accountId;
--- a/im/content/engineManager.js
+++ b/im/content/engineManager.js
@@ -70,19 +70,19 @@ var gEngineManagerDialog = {
loadAddEngines: function engineManager_loadAddEngines() {
this.onOK();
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
var url = formatter.formatURLPref("browser.search.searchEnginesURL");
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Ci.nsIExternalProtocolService)
- .loadURI(ios.newURI(url), window);
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .loadURI(ios.newURI(url), window);
window.close();
},
remove: function engineManager_remove() {
gEngineView._engineStore.removeEngine(gEngineView.selectedEngine);
var index = gEngineView.selectedIndex;
gEngineView.rowCountChanged(index, -1);
--- a/im/content/instantbird.js
+++ b/im/content/instantbird.js
@@ -88,17 +88,17 @@ var XULBrowserWindow = {
overLink: "",
statusText: "",
QueryInterface: function (aIID) {
if (aIID.equals(Ci.nsISupportsWeakReference) ||
aIID.equals(Ci.nsIXULBrowserWindow) ||
aIID.equals(Ci.nsISupports))
return this;
- throw Components.results.NS_NOINTERFACE;
+ throw Cr.NS_NOINTERFACE;
},
get statusTextField () {
return getTabBrowser().getStatusPanel();
},
setStatus: function (status) {
this.status = status;
--- a/im/content/jsTreeView.js
+++ b/im/content/jsTreeView.js
@@ -221,15 +221,15 @@ PROTO_TREE_VIEW.prototype = {
// Note that as we iterate through here, .length may grow
for (let i = 0; i < this._rowMap.length; i++) {
if (this._persistOpenMap.includes(this._rowMap[i].id))
this.toggleOpenState(i);
}
},
QueryInterface: function QueryInterface(aIID) {
- if (aIID.equals(Components.interfaces.nsITreeView) ||
- aIID.equals(Components.interfaces.nsISupports))
+ if (aIID.equals(Ci.nsITreeView) ||
+ aIID.equals(Ci.nsISupports))
return this;
- throw Components.results.NS_ERROR_NO_INTERFACE;
+ throw Cr.NS_ERROR_NO_INTERFACE;
}
};
--- a/im/content/menus.js
+++ b/im/content/menus.js
@@ -62,21 +62,21 @@ var menus = {
updates: function menu_updates() {
Core.showUpdates();
},
displayUpdateStatus: function menu_displayUpdateStatus() {
// copied from buildHelpMenu in mozilla/browser/base/content/utilityOverlay.js
var updates =
- Components.classes["@mozilla.org/updates/update-service;1"]
- .getService(Components.interfaces.nsIApplicationUpdateService);
+ Cc["@mozilla.org/updates/update-service;1"]
+ .getService(Ci.nsIApplicationUpdateService);
var um =
- Components.classes["@mozilla.org/updates/update-manager;1"]
- .getService(Components.interfaces.nsIUpdateManager);
+ Cc["@mozilla.org/updates/update-manager;1"]
+ .getService(Ci.nsIUpdateManager);
// Disable the UI if the update enabled pref has been locked by the
// administrator or if we cannot update for some other reason
var checkForUpdates = document.getElementById("updatesMenuItem");
var canCheckForUpdates = updates.canCheckForUpdates;
checkForUpdates.setAttribute("disabled", !canCheckForUpdates);
if (!canCheckForUpdates)
return;
--- a/im/content/newtab.xml
+++ b/im/content/newtab.xml
@@ -30,18 +30,18 @@
</xul:vbox>
</content>
<implementation implements="nsIObserver">
<property name="statsService" readonly="true">
<getter>
<![CDATA[
if (!this._statsService) {
- this._statsService = Components.classes["@instantbird.org/conv-stats-service;1"]
- .getService(Components.interfaces.ibIConvStatsService);
+ this._statsService = Cc["@instantbird.org/conv-stats-service;1"]
+ .getService(Ci.ibIConvStatsService);
}
return this._statsService;
]]>
</getter>
</property>
<property name="filterbox" readonly="true">
<getter>
@@ -158,17 +158,17 @@
</method>
<method name="getNextConv">
<body>
<![CDATA[
if (!this.hasMoreConversations)
return null;
return this.filteredConvs.getNext()
- .QueryInterface(Components.interfaces.ibIPossibleConversation);
+ .QueryInterface(Ci.ibIPossibleConversation);
]]>
</body>
</method>
<!-- Remove observers when closing tab. -->
<method name="destroy">
<body>
<![CDATA[
@@ -234,17 +234,17 @@
<!-- Dispatch a call to _delayedRefresh, to avoid multiple consecutive calls. -->
<method name="refresh">
<body>
<![CDATA[
if (this._pendingRefreshCall)
return;
this._pendingRefreshCall = true;
Services.tm.mainThread.dispatch(this._delayedRefresh.bind(this),
- Components.interfaces.nsIEventTarget.DISPATCH_NORMAL);
+ Ci.nsIEventTarget.DISPATCH_NORMAL);
]]>
</body>
</method>
<field name="_prevFilterTxt">null</field>
<method name="_delayedRefresh">
<body>
<![CDATA[
--- a/im/content/preferences/advanced.js
+++ b/im/content/preferences/advanced.js
@@ -276,18 +276,18 @@ var gAdvancedPane = {
if (!enabledPref.value) // Don't care for autoPref.value in this case.
radiogroup.value="manual"; // 3. Never check for updates.
else if (autoPref.value) // enabledPref.value && autoPref.value
radiogroup.value="auto"; // 1. Automatically install updates for Desktop only
else // enabledPref.value && !autoPref.value
radiogroup.value="checkOnly"; // 2. Check, but let me choose
- var canCheck = Components.classes["@mozilla.org/updates/update-service;1"].
- getService(Components.interfaces.nsIApplicationUpdateService).
+ var canCheck = Cc["@mozilla.org/updates/update-service;1"].
+ getService(Ci.nsIApplicationUpdateService).
canCheckForUpdates;
// canCheck is false if the enabledPref is false and locked,
// or the binary platform or OS version is not known.
// A locked pref is sufficient to disable the radiogroup.
radiogroup.disabled = !canCheck || enabledPref.locked || autoPref.locked;
var modePref = document.getElementById("app.update.mode");
var warnIncompatible = document.getElementById("warnIncompatible");
@@ -295,36 +295,36 @@ var gAdvancedPane = {
warnIncompatible.disabled = radiogroup.disabled || modePref.locked ||
!enabledPref.value || !autoPref.value;
#ifdef MOZ_MAINTENANCE_SERVICE
// Check to see if the maintenance service is installed.
// If it is don't show the preference at all.
var installed;
try {
- var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
- .createInstance(Components.interfaces.nsIWindowsRegKey);
+ var wrk = Cc["@mozilla.org/windows-registry-key;1"]
+ .createInstance(Ci.nsIWindowsRegKey);
wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
"SOFTWARE\\Mozilla\\MaintenanceService",
wrk.ACCESS_READ | wrk.WOW64_64);
installed = wrk.readIntValue("Installed");
wrk.close();
} catch(e) {
}
if (installed != 1) {
document.getElementById("useService").hidden = true;
}
try {
const DRIVE_FIXED = 3;
const LPCWSTR = ctypes.char16_t.ptr;
const UINT = ctypes.uint32_t;
let kernel32 = ctypes.open("kernel32");
let GetDriveType = kernel32.declare("GetDriveTypeW", ctypes.default_abi, UINT, LPCWSTR);
- var UpdatesDir = Components.classes["@mozilla.org/updates/update-service;1"].
- getService(Components.interfaces.nsIApplicationUpdateService);
+ var UpdatesDir = Cc["@mozilla.org/updates/update-service;1"].
+ getService(Ci.nsIApplicationUpdateService);
let rootPath = UpdatesDir.getUpdatesDirectory();
while (rootPath.parent != null) {
rootPath = rootPath.parent;
}
if (GetDriveType(rootPath.path) != DRIVE_FIXED) {
document.getElementById("useService").hidden = true;
}
kernel32.close();
@@ -404,18 +404,18 @@ var gAdvancedPane = {
return !warnIncompatible.checked ? 0 : gAdvancedPane._modePreference;
},
/**
* Displays the history of installed updates.
*/
showUpdates: function ()
{
- var prompter = Components.classes["@mozilla.org/updates/update-prompt;1"]
- .createInstance(Components.interfaces.nsIUpdatePrompt);
+ var prompter = Cc["@mozilla.org/updates/update-prompt;1"]
+ .createInstance(Ci.nsIUpdatePrompt);
prompter.showUpdateHistory(window);
},
#endif
// ENCRYPTION TAB
/*
* Preferences:
--- a/im/content/preferences/connection.js
+++ b/im/content/preferences/connection.js
@@ -100,18 +100,18 @@ var gConnectionsDialog = {
// if the current value of the PAC textbox does not match the value stored
// in prefs. Likewise, disable the reload button if PAC is not configured
// in prefs.
var typedURL = document.getElementById("networkProxyAutoconfigURL").value;
var proxyTypeCur = document.getElementById("network.proxy.type").value;
var prefs =
- Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch);
+ Cc["@mozilla.org/preferences-service;1"].
+ getService(Ci.nsIPrefBranch);
var pacURL = prefs.getCharPref("network.proxy.autoconfig_url");
var proxyType = prefs.getIntPref("network.proxy.type");
var disableReloadPref =
document.getElementById("pref.advanced.proxies.disable_button.reload");
disableReloadPref.disabled =
(proxyTypeCur != 2 || proxyType != 2 || typedURL != pacURL);
},
@@ -165,26 +165,26 @@ var gConnectionsDialog = {
}
var backupPref = document.getElementById("network.proxy.backup." + aProtocol + (aIsPort ? "_port" : ""));
return backupPref.hasUserValue ? backupPref.value : undefined;
},
reloadPAC: function ()
{
- Components.classes["@mozilla.org/network/protocol-proxy-service;1"].
+ Cc["@mozilla.org/network/protocol-proxy-service;1"].
getService().reloadPAC();
},
doAutoconfigURLFixup: function ()
{
var autoURL = document.getElementById("networkProxyAutoconfigURL");
var autoURLPref = document.getElementById("network.proxy.autoconfig_url");
- var URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
- .getService(Components.interfaces.nsIURIFixup);
+ var URIFixup = Cc["@mozilla.org/docshell/urifixup;1"]
+ .getService(Ci.nsIURIFixup);
try {
autoURLPref.value = autoURL.value = URIFixup.createFixupURI(autoURL.value, 0).spec;
} catch(ex) {}
},
sanitizeNoProxiesPref: function()
{
var noProxiesPref = document.getElementById("network.proxy.no_proxies_on");
--- a/im/content/preferences/themes.js
+++ b/im/content/preferences/themes.js
@@ -29,22 +29,22 @@ var gThemePane = {
prefURL = PREF_EXTENSIONS_GETMOREMESSAGESTYLESURL;
break;
default:
return;
}
var getMore = document.getElementById("getMore" + aType);
var showGetMore = false;
- const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
+ const nsIPrefBranch = Ci.nsIPrefBranch;
if (Services.prefs.getPrefType(prefURL) != nsIPrefBranch.PREF_INVALID) {
try {
- var getMoreURL = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
- .getService(Components.interfaces.nsIURLFormatter)
- .formatURLPref(prefURL);
+ var getMoreURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
+ .getService(Ci.nsIURLFormatter)
+ .formatURLPref(prefURL);
getMore.setAttribute("getMoreURL", getMoreURL);
showGetMore = getMoreURL != "about:blank";
}
catch (e) { }
}
getMore.hidden = !showGetMore;
},
@@ -86,19 +86,19 @@ var gThemePane = {
// Set it to deactivated if it is not active;
// this is independent from the reason displayed.
if (!aItem.isActive || aItem.userDisabled)
item.setAttribute("disabled", "true");
});
},
openURL: function (aURL) {
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService)
- .loadURI(Services.io.newURI(aURL));
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .loadURI(Services.io.newURI(aURL));
},
// Getting the extension list is slow, return a cached copy of the list
getExtensionList: function () {
if (!this.extensionList)
throw "The add-ons list should be loaded by now...";
return this.extensionList;
}
--- a/im/content/proxies.js
+++ b/im/content/proxies.js
@@ -37,18 +37,18 @@ var gProxies = {
proxyInfo = new proxyInfoCtr();
proxyInfo.type = Ci.purpleIProxyInfo.noProxy;
document.getElementById("noProxy").proxy = proxyInfo;
var useEnv = document.getElementById("useEnvironment");
proxyInfo = new proxyInfoCtr();
proxyInfo.type = Ci.purpleIProxyInfo.useEnvVar;
useEnv.proxy = proxyInfo;
- var environment = Components.classes["@mozilla.org/process/environment;1"]
- .getService(Ci.nsIEnvironment);
+ var environment = Cc["@mozilla.org/process/environment;1"]
+ .getService(Ci.nsIEnvironment);
var envproxy = environment.get("HTTP_PROXY") ||
environment.get("http_proxy") ||
environment.get("HTTPPROXY");
if (envproxy)
document.getElementById("envProxy").textContent = envproxy;
var proxies = getIter(pcs.getProxies());
var proxyList = document.getElementById("proxylist");
--- a/im/content/tabbrowser.xml
+++ b/im/content/tabbrowser.xml
@@ -293,33 +293,33 @@
if (tabKeyCodes.includes(event.keyCode))
return;
// Focus the panel and pass the key to it.
event.preventDefault();
event.stopPropagation();
this.selectedPanel.focus();
- const masks = Components.interfaces.nsIDOMNSEvent;
+ const masks = Ci.nsIDOMNSEvent;
var modifiers = 0;
if (event.shiftKey)
modifiers |= masks.SHIFT_MASK;
if (event.ctrlKey)
modifiers |= masks.CONTROL_MASK;
if (event.altKey)
modifiers |= masks.ALT_MASK;
if (event.metaKey)
modifiers |= masks.META_MASK;
if (event.accelKey)
modifiers |= (navigator.platform.includes("Mac")) ? masks.META_MASK
: masks.CONTROL_MASK;
// Can't use dispatchEvent to the textbox as these refuse untrusted key events.
this.selectedPanel.ownerDocument.defaultView
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils)
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils)
.sendKeyEvent(event.type, event.keyCode, event.charCode, modifiers);
]]>
</body>
</method>
<method name="onTabClick">
<parameter name="aEvent"/>
<body>
@@ -486,17 +486,17 @@
this.mPanelContainer.appendChild(aPanel);
var t = this.mTabContainer.addTab();
aPanel.tab = t;
if (aPanel.browser)
t.linkedBrowser = aPanel.browser;
if (aConv) {
- aConv.QueryInterface(Components.interfaces.imIConversation);
+ aConv.QueryInterface(Ci.imIConversation);
// set up the shared autoscroll popup if it doesn't exist yet
if (!this._autoScrollPopup) {
this._autoScrollPopup = aPanel.browser._createAutoScrollPopup();
this._autoScrollPopup.id = "autoscroller";
this.appendChild(this._autoScrollPopup);
}
aPanel.setAttribute("contenttooltip", this.getAttribute("contenttooltip"));
aPanel.setAttribute("contentcontextmenu", this.getAttribute("contentcontextmenu"));
@@ -883,17 +883,17 @@
<method name="getStatusPanel">
<body><![CDATA[
// These two methods are kept close to the original, but note
// that unlike the tabbrowser.xml in browser/, we need to add
// a statuspanel to all tab panels with a browser element.
if (!this.selectedBrowser) {
- Components.utils.reportError("Browser element in a tab panel " +
+ Cu.reportError("Browser element in a tab panel " +
"without a browser property");
return null;
}
let statusPanel = this.selectedPanel._statusPanel;
if (!statusPanel) {
statusPanel =
document.createElementNS(this.namespaceURI, "statuspanel");
@@ -1190,18 +1190,18 @@
in the current window, in which case this will do nothing. -->
<method name="replaceTabsWithWindow">
<parameter name="aTabs"/>
<body>
<![CDATA[
if (this.mTabs.length == 1)
return null;
- var ma = Components.classes["@mozilla.org/array;1"]
- .createInstance(Components.interfaces.nsIMutableArray);
+ var ma = Cc["@mozilla.org/array;1"]
+ .createInstance(Ci.nsIMutableArray);
aTabs.forEach(function(aTab) { ma.appendElement(aTab); });
// tell a new window to take the "dropped" tab
return Services.ww.openWindow(window,
getConvWindowURL(),
null,
"chrome,dialog=no,all",
ma);
@@ -1972,22 +1972,22 @@
null
</field>
<constructor><![CDATA[
// We cannot cache the XULBrowserWindow object itself since it might
// be set after this binding is constructed.
try {
this._xulWindow =
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation)
- .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
+ window.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIXULWindow);
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIXULWindow);
}
catch(ex) { }
]]></constructor>
<method name="_menuItemOnCommand">
<parameter name="aEvent"/>
<body><![CDATA[
--- a/im/modules/ibCore.jsm
+++ b/im/modules/ibCore.jsm
@@ -38,31 +38,31 @@ var Core = {
false, true);
}
},
init: function() {
try {
// Set the Vendor for breakpad only
if ("nsICrashReporter" in Ci) {
- Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Ci.nsICrashReporter)
- .annotateCrashReport("Vendor", "Instantbird");
+ Cc["@mozilla.org/xre/app-info;1"]
+ .getService(Ci.nsICrashReporter)
+ .annotateCrashReport("Vendor", "Instantbird");
}
} catch(e) {
// This can fail if breakpad isn't enabled,
// don't worry too much about this exception.
}
if (!Ci.imICoreService) {
this._promptError("startupFailure.purplexpcomFileError");
return false;
}
- if (!Components.classes["@mozilla.org/chat/core-service;1"]) {
+ if (!Cc["@mozilla.org/chat/core-service;1"]) {
this._promptError("startupFailure.xpcomRegistrationError");
return false;
}
// Trigger asynchronous initialization of the password service.
Services.logins.initializationPromise.catch(() => {
this._promptError("startupFailure.passwordServiceError");
});
@@ -103,22 +103,22 @@ var Core = {
priority: Ci.imICommand.CMD_PRIORITY_DEFAULT,
run: function (aMsg, aConv) {
let page = aMsg.replace(/^about:/, "");
let url = "about:" + page;
// If the page doesn't exist, we avoid opening a tab.
try {
Services.io.newChannelFromURI(Services.io.newURI(url));
} catch(e) {
- if (e.result == Components.results.NS_ERROR_MALFORMED_URI) {
+ if (e.result == Cr.NS_ERROR_MALFORMED_URI) {
Services.conversations.getUIConversation(aConv).systemMessage(
self.bundle("aboutCommand.invalidPageMessage", page));
return true;
}
- Components.utils.reportError(e); // Log unexpected errors.
+ Cu.reportError(e); // Log unexpected errors.
return false;
}
self.showTab("aboutPanel", aPanel => aPanel.showAboutPage(page));
return true;
}
});
Services.cmd.registerCommand({
@@ -175,21 +175,21 @@ var Core = {
this.showWindow("Messenger:Preferences",
"chrome://instantbird/content/preferences/preferences.xul",
"Preferences",
"chrome,titlebar,toolbar,centerscreen,dialog=no");
},
showUpdates: function() {
// copied from checkForUpdates in mozilla/browser/base/content/utilityOverlay.js
var um =
- Components.classes["@mozilla.org/updates/update-manager;1"]
- .getService(Components.interfaces.nsIUpdateManager);
+ Cc["@mozilla.org/updates/update-manager;1"]
+ .getService(Ci.nsIUpdateManager);
var prompter =
- Components.classes["@mozilla.org/updates/update-prompt;1"]
- .createInstance(Components.interfaces.nsIUpdatePrompt);
+ Cc["@mozilla.org/updates/update-prompt;1"]
+ .createInstance(Ci.nsIUpdatePrompt);
// If there's an update ready to be applied, show the "Update Downloaded"
// UI instead and let the user know they have to restart the browser for
// the changes to be applied.
if (um.activeUpdate && um.activeUpdate.state == "pending")
prompter.showUpdateDownloaded(um.activeUpdate);
else
prompter.checkForUpdates();
@@ -309,17 +309,17 @@ var Core = {
clearTimeout(this._pendingShowAccountManager);
this._pendingShowAccountManager = true;
return;
}
},
_onQuitRequest: function (aCancelQuit, aQuitType) {
// The request has already been canceled somewhere else
- if ((aCancelQuit instanceof Components.interfaces.nsISupportsPRBool)
+ if ((aCancelQuit instanceof Ci.nsISupportsPRBool)
&& aCancelQuit.data)
return;
if (!Services.prefs.getBoolPref("messenger.warnOnQuit"))
return;
let unreadConvsCount =
Services.conversations.getUIConversations()
@@ -361,17 +361,17 @@ var Core = {
_promptError: function(aKeyString, aMessage) {
var bundle = this.bundle;
var title = bundle("startupFailure.title");
var message = bundle("startupFailure.apologize") + "\n\n" +
(aMessage ? bundle(aKeyString, aMessage)
: bundle(aKeyString) + "\n\n" + bundle("startupFailure.update"));
- const nsIPromptService = Components.interfaces.nsIPromptService;
+ const nsIPromptService = Ci.nsIPromptService;
const flags =
nsIPromptService.BUTTON_POS_1 * nsIPromptService.BUTTON_TITLE_IS_STRING +
nsIPromptService.BUTTON_POS_0 * nsIPromptService.BUTTON_TITLE_IS_STRING;
var prompts = Services.prompt;
if (!prompts.confirmEx(null, title, message, flags,
bundle("startupFailure.buttonUpdate"),
bundle("startupFailure.buttonClose"),
--- a/im/modules/ibNotifications.jsm
+++ b/im/modules/ibNotifications.jsm
@@ -11,31 +11,31 @@ ChromeUtils.import("resource:///modules/
var Notifications = {
get ellipsis () {
let ellipsis = "[\u2026]";
try {
ellipsis =
Services.prefs.getComplexValue("intl.ellipsis",
- Components.interfaces.nsIPrefLocalizedString).data;
+ Ci.nsIPrefLocalizedString).data;
} catch (e) { }
return ellipsis;
},
_showMessageNotification: function (aMessage) {
// Put the message content into a div node of the hidden HTML window.
let doc = getHiddenHTMLWindow().document;
let xhtmlElement = doc.createElementNS("http://www.w3.org/1999/xhtml", "div");
xhtmlElement.innerHTML = aMessage.displayMessage.replace(/<br>/gi, "<br/>");
// Convert the div node content to plain text.
let encoder =
- Components.classes["@mozilla.org/layout/documentEncoder;1?type=text/plain"]
- .createInstance(Components.interfaces.nsIDocumentEncoder);
+ Cc["@mozilla.org/layout/documentEncoder;1?type=text/plain"]
+ .createInstance(Ci.nsIDocumentEncoder);
encoder.init(doc, "text/plain", 0);
encoder.setNode(xhtmlElement);
let messageText = encoder.encodeToString().replace(/\s+/g, " ");
// Crop the end of the text if needed.
if (messageText.length > 50)
messageText = messageText.substr(0, 50) + this.ellipsis;
@@ -60,19 +60,19 @@ var Notifications = {
};
// Handle third person messages
let name = aMessage.alias || aMessage.who;
if (messageText.startsWith("/me "))
messageText = messageText.replace(/^\/me/, name);
// Finally show the notification!
- Components.classes["@mozilla.org/alerts-service;1"]
- .getService(Components.interfaces.nsIAlertsService)
- .showAlertNotification(icon, name, messageText, true, "", observer);
+ Cc["@mozilla.org/alerts-service;1"]
+ .getService(Ci.nsIAlertsService)
+ .showAlertNotification(icon, name, messageText, true, "", observer);
},
init: function() {
Services.obs.addObserver(Notifications, "new-text");
},
_notificationPrefName: "messenger.options.notifyOfNewMessages",
observe: function(aSubject, aTopic, aData) {
--- a/im/modules/imWindows.jsm
+++ b/im/modules/imWindows.jsm
@@ -79,19 +79,19 @@ var Conversations = {
// for a new window. In this case the conversation will be focused
// automatically anyway.
if (this.isUIConversationDisplayed(uiConv)) {
let conv = this._uiConv[uiConv.id];
let doc = conv.ownerDocument;
doc.getElementById("conversations").selectPanel(conv);
doc.defaultView.focus();
#ifdef XP_MACOSX
- Components.classes["@mozilla.org/widget/macdocksupport;1"]
- .getService(Components.interfaces.nsIMacDockSupport)
- .activateApplication(true);
+ Cc["@mozilla.org/widget/macdocksupport;1"]
+ .getService(Ci.nsIMacDockSupport)
+ .activateApplication(true);
#endif
}
return uiConv;
},
onWindowFocus: function (aWindow) {
let position = this._windows.indexOf(aWindow);
if (position != -1) {
--- a/ldap/xpcom/src/nsLDAPProtocolHandler.js
+++ b/ldap/xpcom/src/nsLDAPProtocolHandler.js
@@ -1,52 +1,52 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
const kNetworkProtocolCIDPrefix = "@mozilla.org/network/protocol;1?name=";
-const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler;
+const nsIProtocolHandler = Ci.nsIProtocolHandler;
function makeProtocolHandler(aCID, aProtocol, aDefaultPort) {
return {
classID: Components.ID(aCID),
QueryInterface: XPCOMUtils.generateQI([nsIProtocolHandler]),
scheme: aProtocol,
defaultPort: aDefaultPort,
protocolFlags: nsIProtocolHandler.URI_NORELATIVE |
nsIProtocolHandler.URI_DANGEROUS_TO_LOAD |
nsIProtocolHandler.ALLOWS_PROXY,
newURI: function (aSpec, aOriginCharset, aBaseURI) {
- var url = Components.classes["@mozilla.org/network/ldap-url;1"]
- .createInstance(Components.interfaces.nsIURI);
+ var url = Cc["@mozilla.org/network/ldap-url;1"]
+ .createInstance(Ci.nsIURI);
- if (url instanceof Components.interfaces.nsILDAPURL)
- url.init(Components.interfaces.nsIStandardURL.URLTYPE_STANDARD,
+ if (url instanceof Ci.nsILDAPURL)
+ url.init(Ci.nsIStandardURL.URLTYPE_STANDARD,
aDefaultPort, aSpec, aOriginCharset, aBaseURI);
return url;
},
newChannel: function (aURI) {
return this.newChannel2(aURI, null);
},
newChannel2: function (aURI, aLoadInfo) {
if ("@mozilla.org/network/ldap-channel;1" in Components.classes) {
- var channel = Components.classes["@mozilla.org/network/ldap-channel;1"]
- .createInstance(Components.interfaces.nsIChannel);
+ var channel = Cc["@mozilla.org/network/ldap-channel;1"]
+ .createInstance(Ci.nsIChannel);
channel.init(aURI);
return channel;
}
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
+ throw Cr.NS_ERROR_NOT_IMPLEMENTED;
},
allowPort: function (port, scheme) {
return port == aDefaultPort;
}
};
}
--- a/mail/base/content/ABSearchDialog.js
+++ b/mail/base/content/ABSearchDialog.js
@@ -5,21 +5,21 @@
ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
ChromeUtils.import("resource:///modules/mailServices.js");
ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
var gSearchSession;
-var nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;
-var nsIMsgSearchTerm = Components.interfaces.nsIMsgSearchTerm;
-var nsMsgSearchOp = Components.interfaces.nsMsgSearchOp;
-var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
-var nsIAbDirectory = Components.interfaces.nsIAbDirectory;
+var nsMsgSearchScope = Ci.nsMsgSearchScope;
+var nsIMsgSearchTerm = Ci.nsIMsgSearchTerm;
+var nsMsgSearchOp = Ci.nsMsgSearchOp;
+var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
+var nsIAbDirectory = Ci.nsIAbDirectory;
var gStatusText;
var gSearchBundle;
var gAddressBookBundle;
var gSearchStopButton;
var gPropertiesCmd;
var gComposeCmd;
@@ -48,22 +48,22 @@ function searchOnLoad()
{
initializeSearchWidgets();
initializeSearchWindowWidgets();
gSearchBundle = document.getElementById("bundle_search");
gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton"));
gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
gAddressBookBundle = document.getElementById("bundle_addressBook");
- gSearchSession = Components.classes[searchSessionContractID].createInstance(Components.interfaces.nsIMsgSearchSession);
+ gSearchSession = Cc[searchSessionContractID].createInstance(Ci.nsIMsgSearchSession);
// initialize a flag for phonetic name search
gSearchPhoneticName =
Services.prefs.getComplexValue("mail.addr_book.show_phonetic_fields",
- Components.interfaces.nsIPrefLocalizedString).data;
+ Ci.nsIPrefLocalizedString).data;
// Initialize globals, see abCommon.js , InitCommonJS()
abList = document.getElementById("abPopup");
if (abList.getItemAtIndex(0) != (kAllDirectoryRoot + "?"))
abList.insertItemAt(0, gAddressBookBundle.getString("allAddressBooks"),
kAllDirectoryRoot + "?");
if (window.arguments && window.arguments[0])
--- a/mail/base/content/FilterListDialog.js
+++ b/mail/base/content/FilterListDialog.js
@@ -81,28 +81,28 @@ var gStatusFeedback = {
};
var filterEditorQuitObserver = {
observe: function(aSubject, aTopic, aData)
{
// Check whether or not we want to veto the quit request (unless another
// observer already did.
if (aTopic == "quit-application-requested" &&
- (aSubject instanceof Components.interfaces.nsISupportsPRBool) &&
+ (aSubject instanceof Ci.nsISupportsPRBool) &&
!aSubject.data)
aSubject.data = !onFilterClose();
}
}
function onLoad()
{
- gFilterListMsgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"]
- .createInstance(Components.interfaces.nsIMsgWindow);
+ gFilterListMsgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
+ .createInstance(Ci.nsIMsgWindow);
gFilterListMsgWindow.domWindow = window;
- gFilterListMsgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL;
+ gFilterListMsgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
gFilterListMsgWindow.statusFeedback = gStatusFeedback;
gFilterListbox = document.getElementById("filterList");
gEditButton = document.getElementById("editButton");
gDeleteButton = document.getElementById("deleteButton");
gCopyToNewButton = document.getElementById("copyToNewButton");
gTopButton = document.getElementById("reorderTopButton");
gUpButton = document.getElementById("reorderUpButton");
@@ -401,17 +401,17 @@ function calculatePositionAndShowCreateF
if ("refresh" in args && args.refresh) {
// On success: reset the search box if necessary!
resetSearchBox(args.newFilter);
rebuildFilterList();
// Select the new filter, it is at the position of previous selection.
gFilterListbox.selectItem(gFilterListbox.getItemAtIndex(position));
if (currentFilter() != args.newFilter)
- Components.utils.reportError("Filter created at an unexpected position!");
+ Cu.reportError("Filter created at an unexpected position!");
}
}
/**
* Delete selected filters.
* 'Selected' is not to be confused with active (checkbox checked)
*/
function onDeleteFilter()
@@ -521,21 +521,21 @@ function moveFilter(motion) {
if (selectedFilter) {
gCurrentFilterList.removeFilter(selectedFilter);
gCurrentFilterList.insertFilterAt(gCurrentFilterList.filterCount, selectedFilter);
rebuildFilterList();
}
return;
case msgMoveMotion.Up:
relativeStep = -1;
- moveFilterNative = Components.interfaces.nsMsgFilterMotion.up;
+ moveFilterNative = Ci.nsMsgFilterMotion.up;
break;
case msgMoveMotion.Down:
relativeStep = +1;
- moveFilterNative = Components.interfaces.nsMsgFilterMotion.down;
+ moveFilterNative = Ci.nsMsgFilterMotion.down;
break;
}
if (!gSearchBox.value) {
// use legacy move filter code: up, down; only if searchBox is empty
moveCurrentFilter(moveFilterNative);
return;
}
@@ -607,18 +607,18 @@ function runSelectedFilters()
gRunFiltersButton.getAttribute("stoplabel")) {
gFilterListMsgWindow.StopUrls();
return;
}
var folder = gRunFiltersFolder._folder || gRunFiltersFolder.selectedItem._folder;
let filterList = MailServices.filters.getTempFilterList(folder);
- let folders = Components.classes["@mozilla.org/array;1"]
- .createInstance(Components.interfaces.nsIMutableArray);
+ let folders = Cc["@mozilla.org/array;1"]
+ .createInstance(Ci.nsIMutableArray);
folders.appendElement(folder);
// make sure the tmp filter list uses the real filter list log stream
filterList.logStream = gCurrentFilterList.logStream;
filterList.loggingEnabled = gCurrentFilterList.loggingEnabled;
let index = 0;
for (let item of gFilterListbox.selectedItems) {
@@ -845,17 +845,17 @@ function getServerThatCanHaveFilters()
// Check to see if default server can have filters.
if (defaultIncomingServer.canHaveFilters)
return defaultIncomingServer;
// If it cannot, check all accounts to find a server
// that can have filters.
let allServers = MailServices.accounts.allServers;
for (let currentServer of fixIterator(allServers,
- Components.interfaces.nsIMsgIncomingServer))
+ Ci.nsIMsgIncomingServer))
{
if (currentServer.canHaveFilters)
return currentServer;
}
return null;
}
@@ -940,17 +940,17 @@ function getFirstFolder(msgFolder)
// Choose Folder for feeds.
if (msgFolder.server.type == "rss")
return null;
if (msgFolder.server.type != "nntp")
{
// Find Inbox for imap and pop; show Choose Folder if not found or
// Local Folders or any other account type.
- const nsMsgFolderFlags = Components.interfaces.nsMsgFolderFlags;
+ const nsMsgFolderFlags = Ci.nsMsgFolderFlags;
// If inbox does not exist then return null.
return msgFolder.getFolderWithFlags(nsMsgFolderFlags.Inbox);
}
// For news, this is the account folder.
return msgFolder;
}
catch (ex) {
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -8,17 +8,17 @@ ChromeUtils.import("resource://gre/modul
var gCurrentFolder;
var gFolderDisplay;
// Although we don't display messages, we have a message display object to
// simplify our code. It's just always disabled.
var gMessageDisplay;
-var nsIMsgWindow = Components.interfaces.nsIMsgWindow;
+var nsIMsgWindow = Ci.nsIMsgWindow;
var gFolderPicker;
var gStatusFeedback;
var gTimelineEnabled = false;
var RDF;
var gSearchBundle;
// Datasource search listener -- made global as it has to be registered
@@ -219,30 +219,30 @@ SearchFolderDisplayWidget.prototype = {
},
};
function searchOnLoad()
{
initializeSearchWidgets();
initializeSearchWindowWidgets();
- messenger = Components.classes["@mozilla.org/messenger;1"]
- .createInstance(Components.interfaces.nsIMessenger);
+ messenger = Cc["@mozilla.org/messenger;1"]
+ .createInstance(Ci.nsIMessenger);
gSearchBundle = document.getElementById("bundle_search");
gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton"));
gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
gMessageDisplay = new NeverVisisbleMessageDisplayWidget();
gFolderDisplay = new SearchFolderDisplayWidget(gMessageDisplay);
gFolderDisplay.messenger = messenger;
gFolderDisplay.msgWindow = msgWindow;
gFolderDisplay.tree = document.getElementById("threadTree");
gFolderDisplay.treeBox = gFolderDisplay.tree.boxObject.QueryInterface(
- Components.interfaces.nsITreeBoxObject);
+ Ci.nsITreeBoxObject);
gFolderDisplay.view.openSearchView();
gFolderDisplay.makeActive();
gFolderDisplay.setColumnStates({
subjectCol: { visible: true },
correspondentCol: { visible: Services.prefs.getBoolPref("mail.threadpane.use_correspondents") },
senderCol: { visible: !Services.prefs.getBoolPref("mail.threadpane.use_correspondents") },
dateCol: { visible: true },
@@ -268,20 +268,20 @@ function searchOnUnload()
}
function initializeSearchWindowWidgets()
{
gFolderPicker = document.getElementById("searchableFolders");
gSearchStopButton = document.getElementById("search-button");
hideMatchAllItem();
- msgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"]
- .createInstance(nsIMsgWindow);
+ msgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
+ .createInstance(nsIMsgWindow);
msgWindow.domWindow = window;
- msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL;
+ msgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
gStatusFeedback = new nsMsgStatusFeedback();
msgWindow.statusFeedback = gStatusFeedback;
// functionality to enable/disable buttons using nsSearchResultsController
// depending of whether items are selected in the search results thread pane.
top.controllers.insertControllerAt(0, nsSearchResultsController);
}
@@ -371,17 +371,17 @@ function getSearchTerms() {
for (let iTerm = 0; iTerm < gSearchTerms.length; iTerm++) {
let termWrapper = gSearchTerms[iTerm].obj;
let realTerm = termCreator.createTerm();
termWrapper.saveTo(realTerm);
// A header search of "" is illegal for IMAP and will cause us to
// explode. You don't want that and I don't want that. So let's check
// if the bloody term is a subject search on a blank string, and if it
// is, let's secretly not add the term. Everyone wins!
- if ((realTerm.attrib != Components.interfaces.nsMsgSearchAttrib.Subject) ||
+ if ((realTerm.attrib != Ci.nsMsgSearchAttrib.Subject) ||
(realTerm.value.str != ""))
searchTerms.push(realTerm);
}
return searchTerms;
}
/**
@@ -401,19 +401,19 @@ function getSearchFolders() {
return searchFolders;
}
function AddSubFolders(folder, outFolders) {
var subFolders = folder.subFolders;
while (subFolders.hasMoreElements()) {
var nextFolder =
- subFolders.getNext().QueryInterface(Components.interfaces.nsIMsgFolder);
+ subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
- if (!(nextFolder.flags & Components.interfaces.nsMsgFolderFlags.Virtual)) {
+ if (!(nextFolder.flags & Ci.nsMsgFolderFlags.Virtual)) {
if (!nextFolder.noSelect)
outFolders.push(nextFolder);
AddSubFolders(nextFolder, outFolders);
}
}
}
@@ -421,19 +421,19 @@ function AddSubFoldersToURI(folder)
{
var returnString = "";
var subFolders = folder.subFolders;
while (subFolders.hasMoreElements())
{
var nextFolder =
- subFolders.getNext().QueryInterface(Components.interfaces.nsIMsgFolder);
+ subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
- if (!(nextFolder.flags & Components.interfaces.nsMsgFolderFlags.Virtual))
+ if (!(nextFolder.flags & Ci.nsMsgFolderFlags.Virtual))
{
if (!nextFolder.noSelect && !nextFolder.isServer)
{
if (returnString.length > 0)
returnString += '|';
returnString += nextFolder.URI;
}
var subFoldersString = AddSubFoldersToURI(nextFolder);
@@ -477,18 +477,18 @@ function GetScopeForFolder(folder)
// whether we have the body and/or junk available or not.
let localType;
try
{
localType = folder.server.localStoreType;
}
catch (e) {} // On error, we'll just assume the default mailbox type
- let hasBody = folder.getFlag(Components.interfaces.nsMsgFolderFlags.Offline);
- let nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;
+ let hasBody = folder.getFlag(Ci.nsMsgFolderFlags.Offline);
+ let nsMsgSearchScope = Ci.nsMsgSearchScope;
switch (localType)
{
case "news":
// News has four offline scopes, depending on whether junk and body
// are available.
let hasJunk =
folder.getInheritedStringProperty("dobayes.mailnews@mozilla.org#junk")
== "true";
@@ -505,34 +505,34 @@ function GetScopeForFolder(folder)
// Junk is always enabled for imap, so the offline scope only depends on
// whether the body is available.
// If we are the root folder, use the server property for body rather
// than the folder property.
if (folder.isServer)
{
let imapServer = folder.server
- .QueryInterface(Components.interfaces.nsIImapIncomingServer);
+ .QueryInterface(Ci.nsIImapIncomingServer);
if (imapServer && imapServer.offlineDownload)
hasBody = true;
}
if (!hasBody)
return nsMsgSearchScope.onlineManual;
// fall through to default
default:
return nsMsgSearchScope.offlineMail;
}
}
-var nsMsgViewSortType = Components.interfaces.nsMsgViewSortType;
-var nsMsgViewSortOrder = Components.interfaces.nsMsgViewSortOrder;
-var nsMsgViewFlagsType = Components.interfaces.nsMsgViewFlagsType;
-var nsMsgViewCommandType = Components.interfaces.nsMsgViewCommandType;
+var nsMsgViewSortType = Ci.nsMsgViewSortType;
+var nsMsgViewSortOrder = Ci.nsMsgViewSortOrder;
+var nsMsgViewFlagsType = Ci.nsMsgViewFlagsType;
+var nsMsgViewCommandType = Ci.nsMsgViewCommandType;
function goUpdateSearchItems(commandset)
{
for (var i = 0; i < commandset.childNodes.length; i++)
{
var commandID = commandset.childNodes[i].getAttribute("id");
if (commandID)
{
@@ -561,17 +561,17 @@ function MoveMessageInSearch(destFolder)
// Get the msg folder we're moving messages into.
// If the id (uri) is not set, use file-uri which is set for
// "File Here".
let destUri = destFolder.getAttribute('id');
if (destUri.length == 0)
destUri = destFolder.getAttribute('file-uri');
let destMsgFolder = MailUtils.getFolderForURI(destUri)
- .QueryInterface(Components.interfaces.nsIMsgFolder);
+ .QueryInterface(Ci.nsIMsgFolder);
gFolderDisplay.hintAboutToDeleteMessages();
gFolderDisplay.doCommandWithFolder(nsMsgViewCommandType.moveMessages,
destMsgFolder);
}
function OpenInFolder()
{
--- a/mail/base/content/aboutDialog-appUpdater.js
+++ b/mail/base/content/aboutDialog-appUpdater.js
@@ -10,17 +10,17 @@ ChromeUtils.import("resource://gre/modul
const PREF_APP_UPDATE_CANCELATIONS_OSX = "app.update.cancelations.osx";
const PREF_APP_UPDATE_ELEVATE_NEVER = "app.update.elevate.never";
var gAppUpdater;
function onUnload(aEvent) {
if (gAppUpdater.isChecking)
- gAppUpdater.checker.stopChecking(Components.interfaces.nsIUpdateChecker.CURRENT_CHECK);
+ gAppUpdater.checker.stopChecking(Ci.nsIUpdateChecker.CURRENT_CHECK);
// Safe to call even when there isn't a download in progress.
gAppUpdater.removeDownloadListener();
gAppUpdater = null;
}
function appUpdater()
{
@@ -214,36 +214,36 @@ appUpdater.prototype =
* which is presented after the download has been downloaded.
*/
buttonRestartAfterDownload: function() {
if (!this.isPending && !this.isApplied) {
return;
}
// Notify all windows that an application quit has been requested.
- let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].
- createInstance(Components.interfaces.nsISupportsPRBool);
+ let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
+ createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
// Something aborted the quit process.
if (cancelQuit.data) {
return;
}
- let appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].
- getService(Components.interfaces.nsIAppStartup);
+ let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
+ getService(Ci.nsIAppStartup);
// If already in safe mode restart in safe mode (bug 327119)
if (Services.appinfo.inSafeMode) {
- appStartup.restartInSafeMode(Components.interfaces.nsIAppStartup.eAttemptQuit);
+ appStartup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit);
return;
}
- appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit |
- Components.interfaces.nsIAppStartup.eRestart);
+ appStartup.quit(Ci.nsIAppStartup.eAttemptQuit |
+ Ci.nsIAppStartup.eRestart);
},
/**
* Implements nsIUpdateCheckListener. The methods implemented by
* nsIUpdateCheckListener are in a different scope from nsIIncrementalDownload
* to make it clear which are used by each interface.
*/
updateCheckListener: {
@@ -292,30 +292,30 @@ appUpdater.prototype =
gAppUpdater.selectPanel("noUpdatesFound");
return;
},
/**
* See nsISupports.idl
*/
QueryInterface: function(aIID) {
- if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) &&
- !aIID.equals(Components.interfaces.nsISupports))
- throw Components.results.NS_ERROR_NO_INTERFACE;
+ if (!aIID.equals(Ci.nsIUpdateCheckListener) &&
+ !aIID.equals(Ci.nsISupports))
+ throw Cr.NS_ERROR_NO_INTERFACE;
return this;
}
},
/**
* Starts the download of an update mar.
*/
startDownload: function() {
if (!this.update)
this.update = this.um.activeUpdate;
- this.update.QueryInterface(Components.interfaces.nsIWritablePropertyBag);
+ this.update.QueryInterface(Ci.nsIWritablePropertyBag);
this.update.setProperty("foregroundDownload", "true");
this.aus.pauseDownload();
let state = this.aus.downloadUpdate(this.update, false);
if (state == "failed") {
this.selectPanel("downloadFailed");
return;
}
@@ -346,32 +346,32 @@ appUpdater.prototype =
onStartRequest: function(aRequest, aContext) {
},
/**
* See nsIRequestObserver.idl
*/
onStopRequest: function(aRequest, aContext, aStatusCode) {
switch (aStatusCode) {
- case Components.results.NS_ERROR_UNEXPECTED:
+ case Cr.NS_ERROR_UNEXPECTED:
if (this.update.selectedPatch.state == "download-failed" &&
(this.update.isCompleteUpdate || this.update.patchCount != 2)) {
// Verification error of complete patch, informational text is held in
// the update object.
this.removeDownloadListener();
this.selectPanel("downloadFailed");
break;
}
// Verification failed for a partial patch, complete patch is now
// downloading so return early and do NOT remove the download listener!
break;
- case Components.results.NS_BINDING_ABORTED:
+ case Cr.NS_BINDING_ABORTED:
// Do not remove UI listener since the user may resume downloading again.
break;
- case Components.results.NS_OK:
+ case Cr.NS_OK:
this.removeDownloadListener();
if (this.backgroundUpdateEnabled) {
this.selectPanel("applying");
let update = this.um.activeUpdate;
let self = this;
Services.obs.addObserver(function selectPanelOnUpdate(aSubject, aTopic, aData) {
// Update the UI when the background updater is finished
let status = aData;
@@ -419,15 +419,15 @@ appUpdater.prototype =
this.downloadStatus.value =
DownloadUtils.getTransferTotal(aProgress, aProgressMax);
},
/**
* See nsISupports.idl
*/
QueryInterface: function(aIID) {
- if (!aIID.equals(Components.interfaces.nsIProgressEventSink) &&
- !aIID.equals(Components.interfaces.nsIRequestObserver) &&
- !aIID.equals(Components.interfaces.nsISupports))
- throw Components.results.NS_ERROR_NO_INTERFACE;
+ if (!aIID.equals(Ci.nsIProgressEventSink) &&
+ !aIID.equals(Ci.nsIRequestObserver) &&
+ !aIID.equals(Ci.nsISupports))
+ throw Cr.NS_ERROR_NO_INTERFACE;
return this;
}
};
--- a/mail/base/content/aboutDialog.js
+++ b/mail/base/content/aboutDialog.js
@@ -20,24 +20,24 @@ function init(aEvent)
var distroIdField = document.getElementById("distributionId");
distroIdField.value = distroId + " - " + distroVersion;
distroIdField.style.display = "block";
try {
// This is in its own try catch due to bug 895473 and bug 900925.
var distroAbout = Services.prefs.getComplexValue("distribution.about",
- Components.interfaces.nsISupportsString);
+ Ci.nsISupportsString);
var distroField = document.getElementById("distribution");
distroField.value = distroAbout;
distroField.style.display = "block";
}
catch (ex) {
// Pref is unset
- Components.utils.reportError(ex);
+ Cu.reportError(ex);
}
}
}
catch (e) {
// Pref is unset
}
// XXX FIXME
@@ -99,14 +99,14 @@ function openAboutTab(url)
{ tabType: "contentTab",
tabParams: {contentPage: url, clickHandler: "specialTabs.aboutClickHandler(event);"} });
}
function openUILink(url, event)
{
if (!event.button) {
let m = ("messenger" in window) ? messenger :
- Components.classes["@mozilla.org/messenger;1"]
- .createInstance(Components.interfaces.nsIMessenger);
+ Cc["@mozilla.org/messenger;1"]
+ .createInstance(Ci.nsIMessenger);
m.launchExternalURL(url);
event.preventDefault();
}
}
--- a/mail/base/content/browserRequest.js
+++ b/mail/base/content/browserRequest.js
@@ -1,27 +1,27 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
-var wpl = Components.interfaces.nsIWebProgressListener;
+var wpl = Ci.nsIWebProgressListener;
var reporterListener = {
_isBusy: false,
get securityButton() {
delete this.securityButton;
return this.securityButton = document.getElementById("security-button");
},
QueryInterface: function(aIID) {
- if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
- aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
- aIID.equals(Components.interfaces.nsISupports))
+ if (aIID.equals(Ci.nsIWebProgressListener) ||
+ aIID.equals(Ci.nsISupportsWeakReference) ||
+ aIID.equals(Ci.nsISupports))
return this;
- throw Components.results.NS_NOINTERFACE;
+ throw Cr.NS_NOINTERFACE;
},
onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in unsigned long*/ aStateFlags,
/*in nsresult*/ aStatus) {
},
@@ -98,16 +98,16 @@ function loadRequestedUrl()
let request = window.arguments[0].wrappedJSObject;
document.getElementById("headerMessage").textContent = request.promptText;
let account = request.account;
if (request.iconURI != "")
document.getElementById("headerImage").src = request.iconURI;
var browser = document.getElementById("requestFrame");
browser.addProgressListener(reporterListener,
- Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+ Ci.nsIWebProgress.NOTIFY_ALL);
var url = request.url;
if (url != "") {
browser.setAttribute("src", url);
document.getElementById("headerMessage").textContent = url;
}
request.loaded(window, browser.webProgress);
}
--- a/mail/base/content/commandglue.js
+++ b/mail/base/content/commandglue.js
@@ -120,23 +120,23 @@ function UpdateStatusMessageCounts(folde
totalElement.hidden = false;
}
}
var gQuotaUICache;
function UpdateStatusQuota(folder)
{
if (!(folder && // no folder selected
- folder instanceof Components.interfaces.nsIMsgImapMailFolder)) // POP etc.
+ folder instanceof Ci.nsIMsgImapMailFolder)) // POP etc.
{
if (typeof(gQuotaUICache) == "object") // ever shown quota
gQuotaUICache.panel.hidden = true;
return;
}
- folder = folder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
+ folder = folder.QueryInterface(Ci.nsIMsgImapMailFolder);
// get element references and prefs
if (typeof(gQuotaUICache) != "object")
{
gQuotaUICache = new Object();
gQuotaUICache.meter = document.getElementById("quotaMeter");
gQuotaUICache.panel = document.getElementById("quotaPanel");
gQuotaUICache.label = document.getElementById("quotaLabel");
@@ -267,22 +267,22 @@ function ConvertSortTypeToColumnID(sortK
default:
dump("unsupported sort key: " + sortKey + "\n");
columnID = "dateCol";
break;
}
return columnID;
}
-var nsMsgViewSortType = Components.interfaces.nsMsgViewSortType;
-var nsMsgViewSortOrder = Components.interfaces.nsMsgViewSortOrder;
-var nsMsgViewFlagsType = Components.interfaces.nsMsgViewFlagsType;
-var nsMsgViewCommandType = Components.interfaces.nsMsgViewCommandType;
-var nsMsgViewType = Components.interfaces.nsMsgViewType;
-var nsMsgNavigationType = Components.interfaces.nsMsgNavigationType;
+var nsMsgViewSortType = Ci.nsMsgViewSortType;
+var nsMsgViewSortOrder = Ci.nsMsgViewSortOrder;
+var nsMsgViewFlagsType = Ci.nsMsgViewFlagsType;
+var nsMsgViewCommandType = Ci.nsMsgViewCommandType;
+var nsMsgViewType = Ci.nsMsgViewType;
+var nsMsgNavigationType = Ci.nsMsgNavigationType;
var gDBView = null;
var gCurViewFlags;
var gCurSortType;
function ChangeMessagePaneVisibility(now_hidden)
{
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -140,19 +140,19 @@ function contentAreaClick(aEvent)
if (!href || aEvent.button == 2)
return true;
// We want all about, http and https links in the message pane to be loaded
// externally in a browser, therefore we need to detect that here and redirect
// as necessary.
let uri = makeURI(href);
- if (Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService)
- .isExposedProtocol(uri.scheme) &&
+ if (Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .isExposedProtocol(uri.scheme) &&
!uri.schemeIs("http") && !uri.schemeIs("https"))
return true;
// Now we're here, we know this should be loaded in an external browser, so
// prevent the default action so we don't try and load it here.
aEvent.preventDefault();
// Let the phishing detector check the link.
@@ -167,35 +167,35 @@ function contentAreaClick(aEvent)
* Forces a url to open in an external application according to the protocol
* service settings.
*
* @param url A url string or an nsIURI containing the url to open.
*/
function openLinkExternally(url)
{
let uri = url;
- if (!(uri instanceof Components.interfaces.nsIURI))
+ if (!(uri instanceof Ci.nsIURI))
uri = Services.io.newURI(url);
// This can fail if there is a problem with the places database.
try {
PlacesUtils.asyncHistory.updatePlaces({
uri: uri,
visits: [{
visitDate: Date.now() * 1000,
- transitionType: Components.interfaces.nsINavHistoryService.TRANSITION_LINK
+ transitionType: Ci.nsINavHistoryService.TRANSITION_LINK
}]
});
} catch (ex) {
- Components.utils.reportError(ex);
+ Cu.reportError(ex);
}
- Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService)
- .loadURI(uri);
+ Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Ci.nsIExternalProtocolService)
+ .loadURI(uri);
}
/**
* Compatibility to Firefox, used for example by devtools to open links. Defer
* this to the external browser for now, since in most cases this is meant to
* open an actionable tab.
*/
function openUILinkIn(url, where, options) {
--- a/mail/base/content/editContactOverlay.js
+++ b/mail/base/content/editContactOverlay.js
@@ -137,22 +137,22 @@ var editContactInlineUI = {
// Is this card contained within mailing lists?
let inMailList = false;
if (this._cardDetails.book.supportsMailingLists) {
// We only have to look in one book here, because cards currently have
// to be in the address book they belong to.
let mailingLists = this._cardDetails.book.childNodes;
while (mailingLists.hasMoreElements() && !inMailList) {
let list = mailingLists.getNext();
- if (!(list instanceof Components.interfaces.nsIAbDirectory) ||
+ if (!(list instanceof Ci.nsIAbDirectory) ||
!list.isMailList)
continue;
for (let card of fixIterator(list.addressLists)) {
- if (card instanceof Components.interfaces.nsIAbCard &&
+ if (card instanceof Ci.nsIAbCard &&
card.primaryEmail == this._cardDetails.card.primaryEmail) {
inMailList = true;
break;
}
}
}
}
@@ -185,18 +185,18 @@ var editContactInlineUI = {
this.panel.hidePopup();
var bundle = document.getElementById("bundle_editContact");
if (!Services.prompt.confirm(window,
bundle.getString("deleteContactTitle"),
bundle.getString("deleteContactMessage")))
return; /* XXX would be nice to bring the popup back up here */
- let cardArray = Components.classes["@mozilla.org/array;1"]
- .createInstance(Components.interfaces.nsIMutableArray);
+ let cardArray = Cc["@mozilla.org/array;1"]
+ .createInstance(Ci.nsIMutableArray);
cardArray.appendElement(this._cardDetails.card);
MailServices.ab.getDirectory(this._cardDetails.book.URI).deleteCards(cardArray);
},
saveChanges: function() {
// If we're a popup dialog, just hide the popup and return
if (!this._writeable) {
@@ -225,17 +225,17 @@ var editContactInlineUI = {
}
else {
// We changed address books for the card.
// Add it to the chosen address book...
this._cardDetails.book.addCard(this._cardDetails.card);
// ...and delete it from the old place.
- let cardArray = Components.classes["@mozilla.org/array;1"]
- .createInstance(Components.interfaces.nsIMutableArray);
+ let cardArray = Cc["@mozilla.org/array;1"]
+ .createInstance(Ci.nsIMutableArray);
cardArray.appendElement(this._cardDetails.card);
originalBook.deleteCards(cardArray);
}
this.panel.hidePopup();
}
}
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -5,18 +5,18 @@
ChromeUtils.import("resource:///modules/dbViewWrapper.js");
ChromeUtils.import("resource:///modules/jsTreeSelection.js");
ChromeUtils.import("resource:///modules/MailUtils.js");
ChromeUtils.import("resource://gre/modules/Services.jsm");
var gFolderDisplay = null;
var gMessageDisplay = null;
-var nsMsgFolderFlags = Components.interfaces.nsMsgFolderFlags;
-var nsMsgMessageFlags = Components.interfaces.nsMsgMessageFlags;
+var nsMsgFolderFlags = Ci.nsMsgFolderFlags;
+var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
/**
* Maintains a list of listeners for all FolderDisplayWidget instances in this
* window. The assumption is that because of our multiplexed tab
* implementation all consumers are effectively going to care about all such
* tabs.
*
* We are not just a global list so that we can add brains about efficiently
@@ -64,18 +64,18 @@ var FolderDisplayListenerManager = {
*/
_fireListeners: function FDBLM__fireListeners(aEventName, aArgs) {
for (let listener of this._listeners) {
if (aEventName in listener) {
try {
listener[aEventName].apply(listener, aArgs);
}
catch(e) {
- Components.utils.reportError(aEventName + " event listener FAILED; " +
- e + " at: " + e.stack);
+ Cu.reportError(aEventName + " event listener FAILED; " +
+ e + " at: " + e.stack);
}
}
}
},
};
/**
* Abstraction for a widget that (roughly speaking) displays the contents of
@@ -208,17 +208,17 @@ FolderDisplayWidget.prototype = {
* @return true if the selection should be summarized for this folder. This
* is based on the mail.operate_on_msgs_in_collapsed_threads pref and
* if we are in a newsgroup folder. XXX When bug 478167 is fixed, this
* should be limited to being disabled for newsgroups that are not stored
* offline.
*/
get summarizeSelectionInFolder() {
return Services.prefs.getBoolPref("mail.operate_on_msgs_in_collapsed_threads") &&
- !(this.displayedFolder instanceof Components.interfaces.nsIMsgNewsFolder);
+ !(this.displayedFolder instanceof Ci.nsIMsgNewsFolder);
},
/**
* @return the nsITreeSelection object for our tree view. This exists for
* the benefit of message tabs that haven't been switched to yet.
* We provide a fake tree selection in those cases.
* @protected
*/
@@ -359,20 +359,20 @@ FolderDisplayWidget.prototype = {
* views. Not all views respect viewFlags, ie single folder non-virtual.
*/
restoreThreadState: function() {
if (!this._active || !this.tree || !this.view.dbView.viewFolder)
return;
if (this.view._threadExpandAll &&
!(this.view.dbView.viewFlags & nsMsgViewFlagsType.kExpandAll))
- this.view.dbView.doCommand(Components.interfaces.nsMsgViewCommandType.expandAll);
+ this.view.dbView.doCommand(Ci.nsMsgViewCommandType.expandAll);
if (!this.view._threadExpandAll &&
this.view.dbView.viewFlags & nsMsgViewFlagsType.kExpandAll)
- this.view.dbView.doCommand(Components.interfaces.nsMsgViewCommandType.collapseAll);
+ this.view.dbView.doCommand(Ci.nsMsgViewCommandType.collapseAll);
},
//@}
/**
* @name Columns
* @protected Folder Display
*/
//@{
@@ -521,17 +521,17 @@ FolderDisplayWidget.prototype = {
if (!this.view.displayedFolder || !this.view.displayedFolder.msgDatabase)
return;
let msgDatabase = this.view.displayedFolder.msgDatabase;
let dbFolderInfo = msgDatabase.dBFolderInfo;
dbFolderInfo.setCharProperty(this.PERSISTED_COLUMN_PROPERTY_NAME,
JSON.stringify(aState));
- msgDatabase.Commit(Components.interfaces.nsMsgDBCommitType.kLargeCommit);
+ msgDatabase.Commit(Ci.nsMsgDBCommitType.kLargeCommit);
},
/**
* Let us know that the state of the columns has changed. This is either due
* to a re-ordering or hidden-ness being toggled.
*
* This method should only be called on (the active) gFolderDisplay.
*/
@@ -542,17 +542,17 @@ FolderDisplayWidget.prototype = {
this._persistColumnStates(this.getColumnStates());
},
/**
* Either inherit the column state of another folder or use heuristics to
* figure out the best column state for the current folder.
*/
_getDefaultColumnsForCurrentFolder: function(aDoNotInherit) {
- const InboxFlag = Components.interfaces.nsMsgFolderFlags.Inbox;
+ const InboxFlag = Ci.nsMsgFolderFlags.Inbox;
// If the view is synthetic, try asking it for its default columns. If it
// fails, just return nothing, since most synthetic views don't care about
// columns anyway.
if (this.view.isSynthetic) {
if ("getDefaultSetting" in this.view._syntheticView)
return this.view._syntheticView.getDefaultSetting("columns");
return {};
@@ -600,17 +600,17 @@ FolderDisplayWidget.prototype = {
if (colId in this.COLUMN_DEFAULT_TESTERS) {
// This is potentially going to be used by extensions; avoid them
// killing us.
try {
shouldShowColumn = this.COLUMN_DEFAULT_TESTERS[colId](this.view);
}
catch (ex) {
shouldShowColumn = false;
- Components.utils.reportError(ex);
+ Cu.reportError(ex);
}
}
state[colId] = {visible: shouldShowColumn};
}
return state;
},
/**
@@ -783,17 +783,17 @@ FolderDisplayWidget.prototype = {
*
* @param aFolder The nsIMsgDBFolder to display.
*/
show: function FolderDisplayWidget_show(aFolder) {
if (aFolder == null) {
this._nonViewFolder = null;
this.view.close();
}
- else if (aFolder instanceof Components.interfaces.nsIMsgFolder) {
+ else if (aFolder instanceof Ci.nsIMsgFolder) {
if (aFolder.isServer) {
this._nonViewFolder = aFolder;
this._showServer();
this.view.close();
// A server is fully loaded immediately, for now. (When we have the
// account summary, we might want to change this to wait for the page
// load to complete.)
this._allMessagesLoaded = true;
@@ -1739,17 +1739,17 @@ FolderDisplayWidget.prototype = {
*/
_showAccountCentral: function FolderDisplayWidget__showAccountCentral() {
var accountBox = document.getElementById("accountCentralBox");
document.getElementById("displayDeck").selectedPanel = accountBox;
var prefName = "mailnews.account_central_page.url";
// oh yeah, 'pref' is a global all right.
var acctCentralPage =
Services.prefs.getComplexValue(prefName,
- Components.interfaces.nsIPrefLocalizedString).data;
+ Ci.nsIPrefLocalizedString).data;
window.frames["accountCentralPane"].location.href = acctCentralPage;
},
/**
* Call this when the tab using us is being hidden.
*/
makeInactive: function FolderDisplayWidget_makeInactive() {
// - things to do before we mark ourselves inactive (because they depend on
@@ -2155,17 +2155,17 @@ FolderDisplayWidget.prototype = {
if (folderIdentity)
return folderIdentity.archiveEnabled;
if (this.displayedFolder.server) {
let serverIdentities = MailServices.accounts.getIdentitiesForServer(
this.displayedFolder.server
);
- const nsIMsgIdentity = Components.interfaces.nsIMsgIdentity;
+ const nsIMsgIdentity = Ci.nsIMsgIdentity;
let allEnabled = undefined;
for (let identity of fixIterator(serverIdentities, nsIMsgIdentity)) {
if (allEnabled === undefined) {
allEnabled = identity.archiveEnabled;
}
else if (identity.archiveEnabled != allEnabled) {
allEnabled = undefined;
break;
@@ -2467,17 +2467,17 @@ FolderDisplayWidget.prototype = {
topPadding--;
else
bottomPadding--;
}
} else {
// Something's gone wrong elsewhere, and we likely have bigger problems.
topPadding = 0;
bottomPadding = 0;
- Components.utils.reportError(
+ Cu.reportError(
"Unable to get height of folder pane (treeBox is null)");
}
return [topPadding, bottomPadding];
},
/**
* Ensure the given view index is visible, optionally with some padding.
@@ -2700,20 +2700,20 @@ FakeTreeBoxObject.prototype = {
},
setProperty : function FakeTreeBoxObject_setProperty(propertyName, value) {
return this.domNode.boxObject.setProperty(propertyName, value);
},
removeProperty : function FakeTreeBoxObject_removeProperty(propertyName) {
return this.domNode.boxObject.removeProperty(propertyName);
},
QueryInterface: function FakeTreeBoxObject_QueryInterface(aIID) {
- if (!aIID.equals(Components.interfaces.nsISupports) &&
- !aIID.equals(Components.interfaces.nsIBoxObject) &&
- !aIID.equals(Components.interfaces.nsITreeBoxObject))
- throw Components.results.NS_ERROR_NO_INTERFACE;
+ if (!aIID.equals(Ci.nsISupports) &&
+ !aIID.equals(Ci.nsIBoxObject) &&
+ !aIID.equals(Ci.nsITreeBoxObject))
+ throw Cr.NS_ERROR_NO_INTERFACE;
return this;
}
};
/*
* Provide attribute and function implementations that complain very loudly if
* they are used. Now, XPConnect will return an error to callers if we don't
* implement part of the interface signature, but this is unlikely to provide
* the visibility we desire. In fact, since it is a simple nsresult error,
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -15,17 +15,17 @@ ChromeUtils.import("resource:///modules/
ChromeUtils.import("resource:///modules/FeedUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
if (typeof FeedMessageHandler != "object")
Services.scriptloader.loadSubScript("chrome://messenger-newsblog/content/newsblogOverlay.js");
var kDefaultMode = "all";
-var nsMsgFolderFlags = Components.interfaces.nsMsgFolderFlags;
+var nsMsgFolderFlags = Ci.nsMsgFolderFlags;
/**
* This file contains the controls and functions for the folder pane.
* The following definitions will be useful to know:
*
* gFolderTreeView - the controller for the folder tree.
* ftvItem - folder tree view item, representing a row in the tree
* mode - folder view type, e.g., all folders, favorite folders, MRU...
@@ -156,17 +156,17 @@ var gFolderTreeView = {
if (aJSONFile) {
// Parse our persistent-open-state json file
let data = IOUtils.loadFileToString(aJSONFile);
if (data) {
try {
this._persistOpenMap = JSON.parse(data);
} catch (x) {
- Components.utils.reportError(
+ Cu.reportError(
gFolderTreeView.messengerBundle
.getFormattedString("failedToReadFile", [aJSONFile, x]));
}
}
}
// Load our data
this._updateCompactState(this.mode);
@@ -1118,25 +1118,25 @@ var gFolderTreeView = {
if (this._treeElement.getAttribute("simplelist") == "true")
return;
// if this was a server that was expanded, let it update its counts
let folder = this._rowMap[aIndex]._folder;
if (aExpandServer) {
if (folder.isServer)
folder.server.performExpand(msgWindow);
- else if (folder instanceof Components.interfaces.nsIMsgImapMailFolder)
+ else if (folder instanceof Ci.nsIMsgImapMailFolder)
folder.performExpand(msgWindow);
}
}
},
_subFoldersWithStringProperty: function ftv_subFoldersWithStringProperty(folder, folders, aFolderName, deep)
{
- for (let child of fixIterator(folder.subFolders, Components.interfaces.nsIMsgFolder)) {
+ for (let child of fixIterator(folder.subFolders, Ci.nsIMsgFolder)) {
// if the folder selection is based on a string propery, use that
if (aFolderName == getSmartFolderName(child)) {
folders.push(child);
// Add sub-folders if requested.
if (deep)
this.addSubFolders(child, folders);
}
else
@@ -1157,17 +1157,17 @@ var gFolderTreeView = {
_allFoldersWithFlag: function ftv_getAllFolders(accounts, aFolderFlag, deep)
{
let folders = [];
for (let acct of accounts) {
let foldersWithFlag = acct.incomingServer.rootFolder.getFoldersWithFlags(aFolderFlag);
if (foldersWithFlag.length > 0) {
for (let folderWithFlag of fixIterator(foldersWithFlag,
- Components.interfaces.nsIMsgFolder)) {
+ Ci.nsIMsgFolder)) {
folders.push(folderWithFlag);
// Add sub-folders of Sent and Archive to the result.
if (deep && (aFolderFlag & (nsMsgFolderFlags.SentMail | nsMsgFolderFlags.Archive)))
this.addSubFolders(folderWithFlag, folders);
}
}
}
return folders;
@@ -1272,17 +1272,17 @@ var gFolderTreeView = {
sortFolderItems(smartFolderItem._children);
return smartFolderItem;
},
_createVFFolder: function ftv_createVFFolder(newName, parentFolder,
searchFolderURIs, folderFlag)
{
let newFolder;
try {
- if (parentFolder instanceof(Components.interfaces.nsIMsgLocalMailFolder))
+ if (parentFolder instanceof(Ci.nsIMsgLocalMailFolder))
newFolder = parentFolder.createLocalSubfolder(newName);
else
newFolder = parentFolder.addSubfolder(newName);
newFolder.setFlag(nsMsgFolderFlags.Virtual);
// provide a way to make the top level folder just a container, not
// a search folder
let type = this._modes["smart"].getSmartFolderTypeByName(newName);
if (type[3]) { // isSearch
@@ -1473,17 +1473,17 @@ var gFolderTreeView = {
},
_sortedAccounts: function ftv_getSortedAccounts() {
let accounts = allAccountsSorted(true);
// Don't show deferred pop accounts.
accounts = accounts.filter(function isNotDeferred(a) {
let server = a.incomingServer;
- return !(server instanceof Components.interfaces.nsIPop3IncomingServer &&
+ return !(server instanceof Ci.nsIPop3IncomingServer &&
server.deferredToAccount);
});
return accounts;
},
/*
* Session cache keyed by folder url, for properties intended to survive
@@ -1660,18 +1660,18 @@ var gFolderTreeView = {
}
return favRootFolders;
},
handleChangedIntProperty: function(aItem, aProperty, aOld, aNew) {
// We want to rebuild if the favorite status of a folder changed.
if (aProperty == "FolderFlag" &&
- ((aOld & Components.interfaces.nsMsgFolderFlags.Favorite) !=
- (aNew & Components.interfaces.nsMsgFolderFlags.Favorite))) {
+ ((aOld & Ci.nsMsgFolderFlags.Favorite) !=
+ (aNew & Ci.nsMsgFolderFlags.Favorite))) {
gFolderTreeView._rebuild();
return true;
}
return false;
}
},
/**
@@ -1715,18 +1715,18 @@ var gFolderTreeView = {
getParentOfFolder: function(aFolder) {
// This is a flat view, so no folders have parents.
return null;
},
handleChangedIntProperty: function(aItem, aProperty, aOld, aNew) {
// We want to rebuild if the favorite status of a folder changed.
if (aProperty == "FolderFlag" &&
- ((aOld & Components.interfaces.nsMsgFolderFlags.Favorite) !=
- (aNew & Components.interfaces.nsMsgFolderFlags.Favorite))) {
+ ((aOld & Ci.nsMsgFolderFlags.Favorite) !=
+ (aNew & Ci.nsMsgFolderFlags.Favorite))) {
gFolderTreeView._rebuild();
return true;
}
return false;
}
},
recent_compact: {
@@ -2047,17 +2047,17 @@ var gFolderTreeView = {
/**
* This is a recursive function to add all subfolders to the array. It
* assumes that the passed in folder itself has already been added.
*
* @param aFolder the folder whose subfolders should be added
* @param folders the array to add the folders to.
*/
addSubFolders : function ftv_addSubFolders (folder, folders) {
- for (let f of fixIterator(folder.subFolders, Components.interfaces.nsIMsgFolder)) {
+ for (let f of fixIterator(folder.subFolders, Ci.nsIMsgFolder)) {
folders.push(f);
this.addSubFolders(f, folders);
}
},
/**
* This updates the rowmap and invalidates the right row(s) in the tree
*/
@@ -2132,28 +2132,28 @@ var gFolderTreeView = {
this._tree.rowCountChanged(newChildIndex, 1);
}
},
/**
* This is our implementation of nsIMsgFolderListener to watch for changes
*/
OnItemAdded: function ftl_add(aParentItem, aItem) {
// Ignore this item if it's not a folder, or we knew about it.
- if (!(aItem instanceof Components.interfaces.nsIMsgFolder) ||
+ if (!(aItem instanceof Ci.nsIMsgFolder) ||
this.getIndexOfFolder(aItem) != null)
return;
// if no parent, this is an account, so let's rebuild.
if (!aParentItem) {
if (!aItem.server.hidden) // ignore hidden server items
this._rebuild();
return;
}
this._modes[this._mode].onFolderAdded(
- aParentItem.QueryInterface(Components.interfaces.nsIMsgFolder), aItem);
+ aParentItem.QueryInterface(Ci.nsIMsgFolder), aItem);
},
addFolder: function ftl_add_folder(aParentItem, aItem)
{
// This intentionally adds any new folder even if it would not pass the
// _filterFunction. The idea is that the user can add new folders even
// in modes like "unread" or "favorite" and could wonder why they
// are not appearing (forgetting they do not meet the criteria of the view).
// The folders will be hidden properly next time the view is rebuilt.
@@ -2192,17 +2192,17 @@ var gFolderTreeView = {
this._toggleRow(parentIndex, false);
return;
}
}
this._addChildToView(parent, parentIndex, newChild);
},
OnItemRemoved: function ftl_remove(aRDFParentItem, aItem) {
- if (!(aItem instanceof Components.interfaces.nsIMsgFolder))
+ if (!(aItem instanceof Ci.nsIMsgFolder))
return;
this._persistItemClosed(aItem.URI);
let index = this.getIndexOfFolder(aItem);
if (index == null)
return;
// forget our parent's children; they'll get rebuilt
@@ -2221,17 +2221,17 @@ var gFolderTreeView = {
},
OnItemPropertyChanged: function(aItem, aProperty, aOld, aNew) {},
OnItemIntPropertyChanged: function(aItem, aProperty, aOld, aNew) {
// First try mode specific handling of the changed property.
if (this._modes[this.mode].handleChangedIntProperty(aItem, aProperty, aOld, aNew))
return;
- if (aItem instanceof Components.interfaces.nsIMsgFolder) {
+ if (aItem instanceof Ci.nsIMsgFolder) {
let index = this.getIndexOfFolder(aItem);
let folder = aItem;
let folderTreeMode = this._modes[this._mode];
// look for first visible ancestor
while (index == null) {
folder = folderTreeMode.getParentOfFolder(folder);
if (!folder)
break;
@@ -2475,17 +2475,17 @@ var gFolderTreeController = {
let rootMsgFolder = folder.server.rootMsgFolder;
if (rootMsgFolder.canCreateSubfolders)
folder = rootMsgFolder;
else // just use the default account
folder = GetDefaultAccountRootFolder();
}
let dualUseFolders = true;
- if (folder.server instanceof Components.interfaces.nsIImapIncomingServer)
+ if (folder.server instanceof Ci.nsIImapIncomingServer)
dualUseFolders = folder.server.dualUseFolders;
function newFolderCallback(aName, aFolder) {
// createSubfolder can throw an exception, causing the newFolder dialog
// to not close and wait for another input.
// TODO: Rewrite this logic and also move the opening of alert dialogs from
// nsMsgLocalMailFolder::CreateSubfolderInternal to here (bug 831190#c16).
if (aName)
@@ -2583,17 +2583,17 @@ var gFolderTreeController = {
*/
renameFolder: function ftc_rename(aFolder) {
let folder = aFolder || gFolderTreeView.getSelectedFolders()[0];
//xxx no need for uri now
let controller = this;
function renameCallback(aName, aUri) {
if (aUri != folder.URI)
- Components.utils.reportError("got back a different folder to rename!");
+ Cu.reportError("got back a different folder to rename!");
controller._tree.view.selection.clearSelection();
// Actually do the rename
folder.rename(aName, msgWindow);
}
window.openDialog("chrome://messenger/content/renameFolderDialog.xul",
"",
@@ -2984,17 +2984,17 @@ var gFolderStatsHelpers = {
* @param aFolder The nsIMsgFolder to analyze.
*/
getSubfoldersSize: function(aFolder) {
let folderSize = 0;
if (aFolder.hasSubFolders) {
let subFolders = aFolder.subFolders;
while (subFolders.hasMoreElements()) {
let subFolder = subFolders.getNext()
- .QueryInterface(Components.interfaces.nsIMsgFolder);
+ .QueryInterface(Ci.nsIMsgFolder);
let subSize = this.getFolderSize(subFolder);
let subSubSize = this.getSubfoldersSize(subFolder);
if (subSize == this.kUnknownSize || subSubSize == this.kUnknownSize)
return subSize;
folderSize += subSize + subSubSize;
}
}
--- a/mail/base/content/macMessengerOverlay.js
+++ b/mail/base/content/macMessengerOverlay.js
@@ -34,17 +34,17 @@ function loadListener(event) {
/**
* When the Preferences window is opened/closed, this observer will be called.
* This is done so subdialog opens as a child of it.
*/
function PrefWindowObserver() {
this.observe = function(aSubject, aTopic, aData) {
if (aTopic == "domwindowopened") {
- let win = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
+ let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
win.addEventListener("load", loadListener, {capture: false, once: true});
}
Services.ww.unregisterNotification(this);
};
}
/**
* Show the Dock Options sub-dialog hanging from the Preferences window.
@@ -68,27 +68,27 @@ function openDockOptions()
/**
* Open a new window for writing a new message
*/
function writeNewMessageDock()
{
// Default identity will be used as sender for the new message.
MailServices.compose.OpenComposeWindow(null, null, null,
- Components.interfaces.nsIMsgCompType.New,
- Components.interfaces.nsIMsgCompFormat.Default, null, null);
+ Ci.nsIMsgCompType.New,
+ Ci.nsIMsgCompFormat.Default, null, null);
}
/**
* Open the address book window
*/
function openAddressBookDock()
{
let win = Services.wm.getMostRecentWindow("mail:addressbook");
if (win) {
win.focus();
} else {
- let ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].
- getService(Components.interfaces.nsIWindowWatcher);
+ let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
+ getService(Ci.nsIWindowWatcher);
ww.openWindow(null, "chrome://messenger/content/addressbook/addressbook.xul", null,
"chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", null);
}
}
--- a/mail/base/content/mail-offline.js
+++ b/mail/base/content/mail-offline.js
@@ -8,18 +8,18 @@ ChromeUtils.import("resource://gre/modul
var MailOfflineMgr = {
offlineManager: null,
offlineBundle: null,
init: function()
{
Services.obs.addObserver(this, "network:offline-status-changed");
- this.offlineManager = Components.classes["@mozilla.org/messenger/offline-manager;1"]
- .getService(Components.interfaces.nsIMsgOfflineManager);
+ this.offlineManager = Cc["@mozilla.org/messenger/offline-manager;1"]
+ .getService(Ci.nsIMsgOfflineManager);
this.offlineBundle = document.getElementById("bundle_offlinePrompts");
// initialize our offline state UI
this.updateOfflineUI(!this.isOnline());
},
uninit: function()
{
@@ -69,19 +69,19 @@ var MailOfflineMgr = {
this.mailOfflineStateChanged(aState == "offline");
},
/**
* @return true if there are unsent messages
*/
haveUnsentMessages: function()
{
- return Components.classes["@mozilla.org/messengercompose/sendlater;1"]
- .getService(Components.interfaces.nsIMsgSendLater)
- .hasUnsentMessages();
+ return Cc["@mozilla.org/messengercompose/sendlater;1"]
+ .getService(Ci.nsIMsgSendLater)
+ .hasUnsentMessages();
},
/**
* open the offline panel in the account manager for the currently loaded
* account.
*/
openOfflineAccountSettings: function()
{
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -526,17 +526,17 @@ var DefaultController =
return folder && folder.server.canEmptyTrashOnExit ?
IsMailFolderSelected() : false;
}
case "button_compact":
{
let folders = gFolderTreeView.getSelectedFolders();
let canCompact = function canCompact(folder) {
return !folder.isServer &&
- !(folder.flags & Components.interfaces.nsMsgFolderFlags.Virtual) &&
+ !(folder.flags & Ci.nsMsgFolderFlags.Virtual) &&
(folder.server.type != "imap" || folder.server.canCompactFoldersOnServer) &&
folder.isCommandEnabled("button_compact");
}
return folders && folders.every(canCompact);
}
case "cmd_compactFolder":
{
let folders = gFolderTreeView.getSelectedFolders();
@@ -677,17 +677,17 @@ var DefaultController =
// selection incorrect.
if (!gRightMouseButtonSavedSelection)
gFolderDisplay.hintAboutToDeleteMessages();
gFolderDisplay.doCommand(nsMsgViewCommandType.deleteMsg);
UpdateDeleteToolbarButton();
break;
case "cmd_cancel":
let message = gFolderDisplay.selectedMessage;
- message.folder.QueryInterface(Components.interfaces.nsIMsgNewsFolder)
+ message.folder.QueryInterface(Ci.nsIMsgNewsFolder)
.cancelMessage(message, msgWindow);
break;
case "button_shiftDelete":
case "cmd_shiftDelete":
MarkSelectedMessagesRead(true);
gFolderDisplay.hintAboutToDeleteMessages();
gFolderDisplay.doCommand(nsMsgViewCommandType.deleteNoTrash);
UpdateDeleteToolbarButton();
@@ -1185,18 +1185,18 @@ function UnloadCommandUpdateHandlers()
function IsSendUnsentMsgsEnabled(unsentMsgsFolder)
{
// If no account has been configured, there are no messages for sending.
if (MailServices.accounts.accounts.length == 0)
return false;
var msgSendlater =
- Components.classes["@mozilla.org/messengercompose/sendlater;1"]
- .getService(Components.interfaces.nsIMsgSendLater);
+ Cc["@mozilla.org/messengercompose/sendlater;1"]
+ .getService(Ci.nsIMsgSendLater);
// If we're currently sending unsent msgs, disable this cmd.
if (msgSendlater.sendingMessages)