summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/mozapps/extensions')
-rw-r--r--toolkit/mozapps/extensions/AddonManager.jsm223
-rw-r--r--toolkit/mozapps/extensions/LightweightThemeManager.jsm30
-rw-r--r--toolkit/mozapps/extensions/addonManager.js30
-rw-r--r--toolkit/mozapps/extensions/amInstallTrigger.js2
-rw-r--r--toolkit/mozapps/extensions/amWebInstallListener.js28
5 files changed, 150 insertions, 163 deletions
diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm
index d453a8981..f9827345c 100644
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -123,13 +123,13 @@ function providerName(aProvider) {
* parent 'addons' level logger accordingly.
*/
var PrefObserver = {
- init: function PrefObserver_init() {
+ init: function() {
Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false);
Services.obs.addObserver(this, "xpcom-shutdown", false);
this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
},
- observe: function PrefObserver_observe(aSubject, aTopic, aData) {
+ observe: function(aSubject, aTopic, aData) {
if (aTopic == "xpcom-shutdown") {
Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
Services.obs.removeObserver(this, "xpcom-shutdown");
@@ -323,7 +323,7 @@ AsyncObjectCaller.prototype = {
* Passes the next object to the listener or calls noMoreObjects if there
* are none left.
*/
- callNext: function AOC_callNext() {
+ callNext: function() {
if (this.objects.length == 0) {
this.listener.noMoreObjects(this);
return;
@@ -449,7 +449,7 @@ AddonAuthor.prototype = {
url: null,
// Returns the author's name, defaulting to the empty string
- toString: function AddonAuthor_toString() {
+ toString: function() {
return this.name || "";
}
}
@@ -493,7 +493,7 @@ AddonScreenshot.prototype = {
caption: null,
// Returns the screenshot URL, defaulting to the empty string
- toString: function AddonScreenshot_toString() {
+ toString: function() {
return this.url || "";
}
}
@@ -640,11 +640,11 @@ var AddonManagerInternal = {
// Store telemetry details per addon provider
telemetryDetails: {},
- recordTimestamp: function AMI_recordTimestamp(name, value) {
+ recordTimestamp: function(name, value) {
this.TelemetryTimestamps.add(name, value);
},
- validateBlocklist: function AMI_validateBlocklist() {
+ validateBlocklist: function() {
let appBlocklist = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]);
// If there is no application shipped blocklist then there is nothing to do
@@ -771,7 +771,7 @@ var AddonManagerInternal = {
* Initializes the AddonManager, loading any known providers and initializing
* them.
*/
- startup: function AMI_startup() {
+ startup: function() {
try {
if (gStarted)
return;
@@ -925,7 +925,7 @@ var AddonManagerInternal = {
* @param aTypes
* An optional array of add-on types
*/
- registerProvider: function AMI_registerProvider(aProvider, aTypes) {
+ registerProvider: function(aProvider, aTypes) {
if (!aProvider || typeof aProvider != "object")
throw Components.Exception("aProvider must be specified",
Cr.NS_ERROR_INVALID_ARG);
@@ -977,7 +977,7 @@ var AddonManagerInternal = {
* For providers that have async shutdown methods returning Promises,
* the caller should wait for that Promise to resolve.
*/
- unregisterProvider: function AMI_unregisterProvider(aProvider) {
+ unregisterProvider: function(aProvider) {
if (!aProvider || typeof aProvider != "object")
throw Components.Exception("aProvider must be specified",
Cr.NS_ERROR_INVALID_ARG);
@@ -1032,7 +1032,7 @@ var AddonManagerInternal = {
*
* @param aProvider Provider object to mark safe
*/
- markProviderSafe: function AMI_markProviderSafe(aProvider) {
+ markProviderSafe: function(aProvider) {
if (!gStarted) {
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1062,7 +1062,7 @@ var AddonManagerInternal = {
* The method name to call
* @see callProvider
*/
- callProviders: function AMI_callProviders(aMethod, ...aArgs) {
+ callProviders: function(aMethod, ...aArgs) {
if (!aMethod || typeof aMethod != "string")
throw Components.Exception("aMethod must be a non-empty string",
Cr.NS_ERROR_INVALID_ARG);
@@ -1163,7 +1163,7 @@ var AddonManagerInternal = {
*
* @see nsIObserver
*/
- observe: function AMI_observe(aSubject, aTopic, aData) {
+ observe: function(aSubject, aTopic, aData) {
switch (aData) {
case PREF_EM_CHECK_COMPATIBILITY: {
let oldValue = gCheckCompatibility;
@@ -1247,7 +1247,7 @@ var AddonManagerInternal = {
* The optional application version to use for %APP_VERSION%
* @return The appropriately escaped URI.
*/
- escapeAddonURI: function AMI_escapeAddonURI(aAddon, aUri, aAppVersion)
+ escapeAddonURI: function(aAddon, aUri, aAppVersion)
{
if (!aAddon || typeof aAddon != "object")
throw Components.Exception("aAddon must be an Addon object",
@@ -1318,7 +1318,7 @@ var AddonManagerInternal = {
* @return Promise{null} Resolves when the background update check is complete
* (the resulting addon installations may still be in progress).
*/
- backgroundUpdateCheck: function AMI_backgroundUpdateCheck() {
+ backgroundUpdateCheck: function() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1347,7 +1347,7 @@ var AddonManagerInternal = {
// be applied
updates.push(new Promise((resolve, reject) => {
addon.findUpdates({
- onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) {
+ onUpdateAvailable: function(aAddon, aInstall) {
// Start installing updates when the add-on can be updated and
// background updates should be applied.
logger.debug("Found update for add-on ${id}", aAddon);
@@ -1389,7 +1389,7 @@ var AddonManagerInternal = {
* @param aID
* The ID of the add-on
*/
- addStartupChange: function AMI_addStartupChange(aType, aID) {
+ addStartupChange: function(aType, aID) {
if (!aType || typeof aType != "string")
throw Components.Exception("aType must be a non-empty string",
Cr.NS_ERROR_INVALID_ARG);
@@ -1418,7 +1418,7 @@ var AddonManagerInternal = {
* @param aID
* The ID of the add-on
*/
- removeStartupChange: function AMI_removeStartupChange(aType, aID) {
+ removeStartupChange: function(aType, aID) {
if (!aType || typeof aType != "string")
throw Components.Exception("aType must be a non-empty string",
Cr.NS_ERROR_INVALID_ARG);
@@ -1444,7 +1444,7 @@ var AddonManagerInternal = {
* @param aMethod
* The method on the listeners to call
*/
- callManagerListeners: function AMI_callManagerListeners(aMethod, ...aArgs) {
+ callManagerListeners: function(aMethod, ...aArgs) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1475,7 +1475,7 @@ var AddonManagerInternal = {
* An optional array of extra InstallListeners to also call
* @return false if any of the listeners returned false, true otherwise
*/
- callInstallListeners: function AMI_callInstallListeners(aMethod,
+ callInstallListeners: function(aMethod,
aExtraListeners, ...aArgs) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
@@ -1517,7 +1517,7 @@ var AddonManagerInternal = {
* @param aMethod
* The method on the listeners to call
*/
- callAddonListeners: function AMI_callAddonListeners(aMethod, ...aArgs) {
+ callAddonListeners: function(aMethod, ...aArgs) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1551,7 +1551,7 @@ var AddonManagerInternal = {
* A boolean indicating if the change will only take place the next
* time the application is restarted
*/
- notifyAddonChanged: function AMI_notifyAddonChanged(aID, aType, aPendingRestart) {
+ notifyAddonChanged: function(aID, aType, aPendingRestart) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1588,7 +1588,7 @@ var AddonManagerInternal = {
* their add-ons in response to an application change such as a blocklist
* update.
*/
- updateAddonAppDisabledStates: function AMI_updateAddonAppDisabledStates() {
+ updateAddonAppDisabledStates: function() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1603,7 +1603,7 @@ var AddonManagerInternal = {
* @param aCallback
* Function to call when operation is complete.
*/
- updateAddonRepositoryData: function AMI_updateAddonRepositoryData(aCallback) {
+ updateAddonRepositoryData: function(aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1613,11 +1613,11 @@ var AddonManagerInternal = {
Cr.NS_ERROR_INVALID_ARG);
new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", {
- nextObject: function updateAddonRepositoryData_nextObject(aCaller, aProvider) {
+ nextObject: function(aCaller, aProvider) {
callProviderAsync(aProvider, "updateAddonRepositoryData",
aCaller.callNext.bind(aCaller));
},
- noMoreObjects: function updateAddonRepositoryData_noMoreObjects(aCaller) {
+ noMoreObjects: function(aCaller) {
safeCall(aCallback);
// only tests should care about this
Services.obs.notifyObservers(null, "TEST:addon-repository-data-updated", null);
@@ -1646,7 +1646,7 @@ var AddonManagerInternal = {
* An optional nsILoadGroup to associate any network requests with
* @throws if the aUrl, aCallback or aMimetype arguments are not specified
*/
- getInstallForURL: function AMI_getInstallForURL(aUrl, aCallback, aMimetype,
+ getInstallForURL: function(aUrl, aCallback, aMimetype,
aHash, aName, aIcons,
aVersion, aBrowser) {
if (!gStarted)
@@ -1716,7 +1716,7 @@ var AddonManagerInternal = {
* An optional mimetype hint for the add-on
* @throws if the aFile or aCallback arguments are not specified
*/
- getInstallForFile: function AMI_getInstallForFile(aFile, aCallback, aMimetype) {
+ getInstallForFile: function(aFile, aCallback, aMimetype) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1734,7 +1734,7 @@ var AddonManagerInternal = {
Cr.NS_ERROR_INVALID_ARG);
new AsyncObjectCaller(this.providers, "getInstallForFile", {
- nextObject: function getInstallForFile_nextObject(aCaller, aProvider) {
+ nextObject: function(aCaller, aProvider) {
callProviderAsync(aProvider, "getInstallForFile", aFile,
function getInstallForFile_safeCall(aInstall) {
if (aInstall)
@@ -1744,7 +1744,7 @@ var AddonManagerInternal = {
});
},
- noMoreObjects: function getInstallForFile_noMoreObjects(aCaller) {
+ noMoreObjects: function(aCaller) {
safeCall(aCallback, null);
}
});
@@ -1760,7 +1760,7 @@ var AddonManagerInternal = {
* A callback which will be passed an array of AddonInstalls
* @throws If the aCallback argument is not specified
*/
- getInstallsByTypes: function AMI_getInstallsByTypes(aTypes, aCallback) {
+ getInstallsByTypes: function(aTypes, aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1776,7 +1776,7 @@ var AddonManagerInternal = {
let installs = [];
new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
- nextObject: function getInstallsByTypes_nextObject(aCaller, aProvider) {
+ nextObject: function(aCaller, aProvider) {
callProviderAsync(aProvider, "getInstallsByTypes", aTypes,
function getInstallsByTypes_safeCall(aProviderInstalls) {
if (aProviderInstalls) {
@@ -1786,7 +1786,7 @@ var AddonManagerInternal = {
});
},
- noMoreObjects: function getInstallsByTypes_noMoreObjects(aCaller) {
+ noMoreObjects: function(aCaller) {
safeCall(aCallback, installs);
}
});
@@ -1798,7 +1798,7 @@ var AddonManagerInternal = {
* @param aCallback
* A callback which will be passed an array of AddonInstalls
*/
- getAllInstalls: function AMI_getAllInstalls(aCallback) {
+ getAllInstalls: function(aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1818,7 +1818,7 @@ var AddonManagerInternal = {
* @return string containing the Addon ID or null
* @see amIAddonManager.mapURIToAddonID
*/
- mapURIToAddonID: function AMI_mapURIToAddonID(aURI) {
+ mapURIToAddonID: function(aURI) {
if (!(aURI instanceof Ci.nsIURI)) {
throw Components.Exception("aURI is not a nsIURI",
Cr.NS_ERROR_INVALID_ARG);
@@ -1843,7 +1843,7 @@ var AddonManagerInternal = {
* The mimetype to check
* @return true if installation is enabled for the mimetype
*/
- isInstallEnabled: function AMI_isInstallEnabled(aMimetype) {
+ isInstallEnabled: function(aMimetype) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1871,7 +1871,7 @@ var AddonManagerInternal = {
* The nsIPrincipal that initiated the install
* @return true if the source is allowed to install this mimetype
*/
- isInstallAllowed: function AMI_isInstallAllowed(aMimetype, aInstallingPrincipal) {
+ isInstallAllowed: function(aMimetype, aInstallingPrincipal) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -1906,10 +1906,7 @@ var AddonManagerInternal = {
* @param aInstalls
* The array of AddonInstalls to be installed
*/
- installAddonsFromWebpage: function AMI_installAddonsFromWebpage(aMimetype,
- aBrowser,
- aInstallingPrincipal,
- aInstalls) {
+ installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal, aInstalls) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -2011,7 +2008,7 @@ var AddonManagerInternal = {
* @param aListener
* The InstallListener to add
*/
- addInstallListener: function AMI_addInstallListener(aListener) {
+ addInstallListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be a InstallListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2027,7 +2024,7 @@ var AddonManagerInternal = {
* @param aListener
* The InstallListener to remove
*/
- removeInstallListener: function AMI_removeInstallListener(aListener) {
+ removeInstallListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be a InstallListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2050,7 +2047,7 @@ var AddonManagerInternal = {
* The callback to pass the retrieved add-on to
* @throws if the aID or aCallback arguments are not specified
*/
- getAddonByID: function AMI_getAddonByID(aID, aCallback) {
+ getAddonByID: function(aID, aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -2064,7 +2061,7 @@ var AddonManagerInternal = {
Cr.NS_ERROR_INVALID_ARG);
new AsyncObjectCaller(this.providers, "getAddonByID", {
- nextObject: function getAddonByID_nextObject(aCaller, aProvider) {
+ nextObject: function(aCaller, aProvider) {
callProviderAsync(aProvider, "getAddonByID", aID,
function getAddonByID_safeCall(aAddon) {
if (aAddon)
@@ -2074,7 +2071,7 @@ var AddonManagerInternal = {
});
},
- noMoreObjects: function getAddonByID_noMoreObjects(aCaller) {
+ noMoreObjects: function(aCaller) {
safeCall(aCallback, null);
}
});
@@ -2089,7 +2086,7 @@ var AddonManagerInternal = {
* The callback to pass the retrieved add-on to.
* @throws if the aGUID or aCallback arguments are not specified
*/
- getAddonBySyncGUID: function AMI_getAddonBySyncGUID(aGUID, aCallback) {
+ getAddonBySyncGUID: function(aGUID, aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -2103,7 +2100,7 @@ var AddonManagerInternal = {
Cr.NS_ERROR_INVALID_ARG);
new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", {
- nextObject: function getAddonBySyncGUID_nextObject(aCaller, aProvider) {
+ nextObject: function(aCaller, aProvider) {
callProviderAsync(aProvider, "getAddonBySyncGUID", aGUID,
function getAddonBySyncGUID_safeCall(aAddon) {
if (aAddon) {
@@ -2114,7 +2111,7 @@ var AddonManagerInternal = {
});
},
- noMoreObjects: function getAddonBySyncGUID_noMoreObjects(aCaller) {
+ noMoreObjects: function(aCaller) {
safeCall(aCallback, null);
}
});
@@ -2129,7 +2126,7 @@ var AddonManagerInternal = {
* The callback to pass an array of Addons to
* @throws if the aID or aCallback arguments are not specified
*/
- getAddonsByIDs: function AMI_getAddonsByIDs(aIDs, aCallback) {
+ getAddonsByIDs: function(aIDs, aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -2145,7 +2142,7 @@ var AddonManagerInternal = {
let addons = [];
new AsyncObjectCaller(aIDs, null, {
- nextObject: function getAddonsByIDs_nextObject(aCaller, aID) {
+ nextObject: function(aCaller, aID) {
AddonManagerInternal.getAddonByID(aID,
function getAddonsByIDs_getAddonByID(aAddon) {
addons.push(aAddon);
@@ -2153,7 +2150,7 @@ var AddonManagerInternal = {
});
},
- noMoreObjects: function getAddonsByIDs_noMoreObjects(aCaller) {
+ noMoreObjects: function(aCaller) {
safeCall(aCallback, addons);
}
});
@@ -2168,7 +2165,7 @@ var AddonManagerInternal = {
* The callback to pass an array of Addons to.
* @throws if the aCallback argument is not specified
*/
- getAddonsByTypes: function AMI_getAddonsByTypes(aTypes, aCallback) {
+ getAddonsByTypes: function(aTypes, aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -2184,7 +2181,7 @@ var AddonManagerInternal = {
let addons = [];
new AsyncObjectCaller(this.providers, "getAddonsByTypes", {
- nextObject: function getAddonsByTypes_nextObject(aCaller, aProvider) {
+ nextObject: function(aCaller, aProvider) {
callProviderAsync(aProvider, "getAddonsByTypes", aTypes,
function getAddonsByTypes_concatAddons(aProviderAddons) {
if (aProviderAddons) {
@@ -2194,7 +2191,7 @@ var AddonManagerInternal = {
});
},
- noMoreObjects: function getAddonsByTypes_noMoreObjects(aCaller) {
+ noMoreObjects: function(aCaller) {
safeCall(aCallback, addons);
}
});
@@ -2206,7 +2203,7 @@ var AddonManagerInternal = {
* @param aCallback
* A callback which will be passed an array of Addons
*/
- getAllAddons: function AMI_getAllAddons(aCallback) {
+ getAllAddons: function(aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -2228,8 +2225,7 @@ var AddonManagerInternal = {
* The callback to pass the array of Addons to
* @throws if the aCallback argument is not specified
*/
- getAddonsWithOperationsByTypes:
- function AMI_getAddonsWithOperationsByTypes(aTypes, aCallback) {
+ getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
@@ -2245,8 +2241,7 @@ var AddonManagerInternal = {
let addons = [];
new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
- nextObject: function getAddonsWithOperationsByTypes_nextObject
- (aCaller, aProvider) {
+ nextObject: function(aCaller, aProvider) {
callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes,
function getAddonsWithOperationsByTypes_concatAddons
(aProviderAddons) {
@@ -2257,7 +2252,7 @@ var AddonManagerInternal = {
});
},
- noMoreObjects: function getAddonsWithOperationsByTypes_noMoreObjects(caller) {
+ noMoreObjects: function(caller) {
safeCall(aCallback, addons);
}
});
@@ -2269,7 +2264,7 @@ var AddonManagerInternal = {
* @param aListener
* The listener to add
*/
- addManagerListener: function AMI_addManagerListener(aListener) {
+ addManagerListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be an AddonManagerListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2285,7 +2280,7 @@ var AddonManagerInternal = {
* @param aListener
* The listener to remove
*/
- removeManagerListener: function AMI_removeManagerListener(aListener) {
+ removeManagerListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be an AddonManagerListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2305,7 +2300,7 @@ var AddonManagerInternal = {
* @param aListener
* The AddonListener to add
*/
- addAddonListener: function AMI_addAddonListener(aListener) {
+ addAddonListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be an AddonListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2321,7 +2316,7 @@ var AddonManagerInternal = {
* @param aListener
* The AddonListener to remove
*/
- removeAddonListener: function AMI_removeAddonListener(aListener) {
+ removeAddonListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be an AddonListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2341,7 +2336,7 @@ var AddonManagerInternal = {
* @param aListener
* The TypeListener to add
*/
- addTypeListener: function AMI_addTypeListener(aListener) {
+ addTypeListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be a TypeListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2357,7 +2352,7 @@ var AddonManagerInternal = {
* @param aListener
* The TypeListener to remove
*/
- removeTypeListener: function AMI_removeTypeListener(aListener) {
+ removeTypeListener: function(aListener) {
if (!aListener || typeof aListener != "object")
throw Components.Exception("aListener must be a TypeListener object",
Cr.NS_ERROR_INVALID_ARG);
@@ -2496,23 +2491,23 @@ var AddonManagerInternal = {
* subject to change at any time.
*/
this.AddonManagerPrivate = {
- startup: function AMP_startup() {
+ startup: function() {
AddonManagerInternal.startup();
},
- registerProvider: function AMP_registerProvider(aProvider, aTypes) {
+ registerProvider: function(aProvider, aTypes) {
AddonManagerInternal.registerProvider(aProvider, aTypes);
},
- unregisterProvider: function AMP_unregisterProvider(aProvider) {
+ unregisterProvider: function(aProvider) {
AddonManagerInternal.unregisterProvider(aProvider);
},
- markProviderSafe: function AMP_markProviderSafe(aProvider) {
+ markProviderSafe: function(aProvider) {
AddonManagerInternal.markProviderSafe(aProvider);
},
- backgroundUpdateCheck: function AMP_backgroundUpdateCheck() {
+ backgroundUpdateCheck: function() {
return AddonManagerInternal.backgroundUpdateCheck();
},
@@ -2526,32 +2521,32 @@ this.AddonManagerPrivate = {
AddonManagerInternal.backgroundUpdateCheck();
},
- addStartupChange: function AMP_addStartupChange(aType, aID) {
+ addStartupChange: function(aType, aID) {
AddonManagerInternal.addStartupChange(aType, aID);
},
- removeStartupChange: function AMP_removeStartupChange(aType, aID) {
+ removeStartupChange: function(aType, aID) {
AddonManagerInternal.removeStartupChange(aType, aID);
},
- notifyAddonChanged: function AMP_notifyAddonChanged(aID, aType, aPendingRestart) {
+ notifyAddonChanged: function(aID, aType, aPendingRestart) {
AddonManagerInternal.notifyAddonChanged(aID, aType, aPendingRestart);
},
- updateAddonAppDisabledStates: function AMP_updateAddonAppDisabledStates() {
+ updateAddonAppDisabledStates: function() {
AddonManagerInternal.updateAddonAppDisabledStates();
},
- updateAddonRepositoryData: function AMP_updateAddonRepositoryData(aCallback) {
+ updateAddonRepositoryData: function(aCallback) {
AddonManagerInternal.updateAddonRepositoryData(aCallback);
},
- callInstallListeners: function AMP_callInstallListeners(...aArgs) {
+ callInstallListeners: function(...aArgs) {
return AddonManagerInternal.callInstallListeners.apply(AddonManagerInternal,
aArgs);
},
- callAddonListeners: function AMP_callAddonListeners(...aArgs) {
+ callAddonListeners: function(...aArgs) {
AddonManagerInternal.callAddonListeners.apply(AddonManagerInternal, aArgs);
},
@@ -2563,16 +2558,16 @@ this.AddonManagerPrivate = {
AddonType: AddonType,
- recordTimestamp: function AMP_recordTimestamp(name, value) {
+ recordTimestamp: function(name, value) {
AddonManagerInternal.recordTimestamp(name, value);
},
_simpleMeasures: {},
- recordSimpleMeasure: function AMP_recordSimpleMeasure(name, value) {
+ recordSimpleMeasure: function(name, value) {
this._simpleMeasures[name] = value;
},
- recordException: function AMP_recordException(aModule, aContext, aException) {
+ recordException: function(aModule, aContext, aException) {
let report = {
module: aModule,
context: aContext
@@ -2592,15 +2587,15 @@ this.AddonManagerPrivate = {
this._simpleMeasures.exception = report;
},
- getSimpleMeasures: function AMP_getSimpleMeasures() {
+ getSimpleMeasures: function() {
return this._simpleMeasures;
},
- getTelemetryDetails: function AMP_getTelemetryDetails() {
+ getTelemetryDetails: function() {
return AddonManagerInternal.telemetryDetails;
},
- setTelemetryDetails: function AMP_setTelemetryDetails(aProvider, aDetails) {
+ setTelemetryDetails: function(aProvider, aDetails) {
AddonManagerInternal.telemetryDetails[aProvider] = aDetails;
},
@@ -2619,7 +2614,7 @@ this.AddonManagerPrivate = {
* This can be used as an implementation for Addon.findUpdates() when
* no update mechanism is available.
*/
- callNoUpdateListeners: function (addon, listener, reason, appVersion, platformVersion) {
+ callNoUpdateListeners: function(addon, listener, reason, appVersion, platformVersion) {
if ("onNoCompatibilityUpdateAvailable" in listener) {
safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon);
}
@@ -2830,14 +2825,13 @@ this.AddonManager = {
return gStartupComplete && !gShutdownInProgress;
},
- getInstallForURL: function AM_getInstallForURL(aUrl, aCallback, aMimetype,
- aHash, aName, aIcons,
- aVersion, aBrowser) {
+ getInstallForURL: function(aUrl, aCallback, aMimetype, aHash, aName, aIcons,
+ aVersion, aBrowser) {
AddonManagerInternal.getInstallForURL(aUrl, aCallback, aMimetype, aHash,
aName, aIcons, aVersion, aBrowser);
},
- getInstallForFile: function AM_getInstallForFile(aFile, aCallback, aMimetype) {
+ getInstallForFile: function(aFile, aCallback, aMimetype) {
AddonManagerInternal.getInstallForFile(aFile, aCallback, aMimetype);
},
@@ -2848,94 +2842,91 @@ this.AddonManager = {
* The type of startup change to get
* @return An array of add-on IDs
*/
- getStartupChanges: function AM_getStartupChanges(aType) {
+ getStartupChangesAM_ge: function(aType) {
if (!(aType in AddonManagerInternal.startupChanges))
return [];
return AddonManagerInternal.startupChanges[aType].slice(0);
},
- getAddonByID: function AM_getAddonByID(aID, aCallback) {
+ getAddonByID: function(aID, aCallback) {
AddonManagerInternal.getAddonByID(aID, aCallback);
},
- getAddonBySyncGUID: function AM_getAddonBySyncGUID(aGUID, aCallback) {
+ getAddonBySyncGUID: function(aGUID, aCallback) {
AddonManagerInternal.getAddonBySyncGUID(aGUID, aCallback);
},
- getAddonsByIDs: function AM_getAddonsByIDs(aIDs, aCallback) {
+ getAddonsByIDs: function(aIDs, aCallback) {
AddonManagerInternal.getAddonsByIDs(aIDs, aCallback);
},
- getAddonsWithOperationsByTypes:
- function AM_getAddonsWithOperationsByTypes(aTypes, aCallback) {
+ getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
AddonManagerInternal.getAddonsWithOperationsByTypes(aTypes, aCallback);
},
- getAddonsByTypes: function AM_getAddonsByTypes(aTypes, aCallback) {
+ getAddonsByTypes: function(aTypes, aCallback) {
AddonManagerInternal.getAddonsByTypes(aTypes, aCallback);
},
- getAllAddons: function AM_getAllAddons(aCallback) {
+ getAllAddons: function(aCallback) {
AddonManagerInternal.getAllAddons(aCallback);
},
- getInstallsByTypes: function AM_getInstallsByTypes(aTypes, aCallback) {
+ getInstallsByTypes: function(aTypes, aCallback) {
AddonManagerInternal.getInstallsByTypes(aTypes, aCallback);
},
- getAllInstalls: function AM_getAllInstalls(aCallback) {
+ getAllInstalls: function(aCallback) {
AddonManagerInternal.getAllInstalls(aCallback);
},
- mapURIToAddonID: function AM_mapURIToAddonID(aURI) {
+ mapURIToAddonID: function(aURI) {
return AddonManagerInternal.mapURIToAddonID(aURI);
},
- isInstallEnabled: function AM_isInstallEnabled(aType) {
+ isInstallEnabled: function(aType) {
return AddonManagerInternal.isInstallEnabled(aType);
},
- isInstallAllowed: function AM_isInstallAllowed(aType, aInstallingPrincipal) {
+ isInstallAllowed: function(aType, aInstallingPrincipal) {
return AddonManagerInternal.isInstallAllowed(aType, ensurePrincipal(aInstallingPrincipal));
},
- installAddonsFromWebpage: function AM_installAddonsFromWebpage(aType, aBrowser,
- aInstallingPrincipal,
- aInstalls) {
+ installAddonsFromWebpage: function(aType, aBrowser, aInstallingPrincipal, aInstalls) {
AddonManagerInternal.installAddonsFromWebpage(aType, aBrowser,
ensurePrincipal(aInstallingPrincipal),
aInstalls);
},
- addManagerListener: function AM_addManagerListener(aListener) {
+ addManagerListener: function(aListener) {
AddonManagerInternal.addManagerListener(aListener);
},
- removeManagerListener: function AM_removeManagerListener(aListener) {
+ removeManagerListener: function(aListener) {
AddonManagerInternal.removeManagerListener(aListener);
},
- addInstallListener: function AM_addInstallListener(aListener) {
+ addInstallListener: function(aListener) {
AddonManagerInternal.addInstallListener(aListener);
},
- removeInstallListener: function AM_removeInstallListener(aListener) {
+ removeInstallListener: function(aListener) {
AddonManagerInternal.removeInstallListener(aListener);
},
- addAddonListener: function AM_addAddonListener(aListener) {
+ addAddonListener: function(aListener) {
AddonManagerInternal.addAddonListener(aListener);
},
- removeAddonListener: function AM_removeAddonListener(aListener) {
+ removeAddonListener: function(aListener) {
AddonManagerInternal.removeAddonListener(aListener);
},
- addTypeListener: function AM_addTypeListener(aListener) {
+ addTypeListener: function(aListener) {
AddonManagerInternal.addTypeListener(aListener);
},
- removeTypeListener: function AM_removeTypeListener(aListener) {
+ removeTypeListener: function(aListener) {
AddonManagerInternal.removeTypeListener(aListener);
},
@@ -2950,7 +2941,7 @@ this.AddonManager = {
* The Addon representing the add-on
* @return true if the addon should auto-update, false otherwise.
*/
- shouldAutoUpdate: function AM_shouldAutoUpdate(aAddon) {
+ shouldAutoUpdate: function(aAddon) {
if (!aAddon || typeof aAddon != "object")
throw Components.Exception("aAddon must be specified",
Cr.NS_ERROR_INVALID_ARG);
@@ -3008,7 +2999,7 @@ this.AddonManager = {
AddonManagerInternal.autoUpdateDefault = aValue;
},
- escapeAddonURI: function AM_escapeAddonURI(aAddon, aUri, aAppVersion) {
+ escapeAddonURI: function(aAddon, aUri, aAppVersion) {
return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion);
},
diff --git a/toolkit/mozapps/extensions/LightweightThemeManager.jsm b/toolkit/mozapps/extensions/LightweightThemeManager.jsm
index 5856bfa91..372a9f3b8 100644
--- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm
+++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm
@@ -110,11 +110,11 @@ this.LightweightThemeManager = {
return _setCurrentTheme(aData, false);
},
- setLocalTheme: function LightweightThemeManager_setLocalTheme(aData) {
+ setLocalTheme: function(aData) {
_setCurrentTheme(aData, true);
},
- getUsedTheme: function LightweightThemeManager_getUsedTheme(aId) {
+ getUsedTheme: function(aId) {
var usedThemes = this.usedThemes;
for (let usedTheme of usedThemes) {
if (usedTheme.id == aId)
@@ -123,7 +123,7 @@ this.LightweightThemeManager = {
return null;
},
- forgetUsedTheme: function LightweightThemeManager_forgetUsedTheme(aId) {
+ forgetUsedTheme: function(aId) {
let theme = this.getUsedTheme(aId);
if (!theme)
return;
@@ -141,7 +141,7 @@ this.LightweightThemeManager = {
AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
},
- previewTheme: function LightweightThemeManager_previewTheme(aData) {
+ previewTheme: function(aData) {
let cancel = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
cancel.data = false;
Services.obs.notifyObservers(cancel, "lightweight-theme-preview-requested",
@@ -160,7 +160,7 @@ this.LightweightThemeManager = {
_notifyWindows(aData);
},
- resetPreview: function LightweightThemeManager_resetPreview() {
+ resetPreview: function() {
if (_previewTimer) {
_previewTimer.cancel();
_previewTimer = null;
@@ -168,7 +168,7 @@ this.LightweightThemeManager = {
}
},
- parseTheme: function LightweightThemeManager_parseTheme(aString, aBaseURI) {
+ parseTheme: function(aString, aBaseURI) {
try {
return _sanitizeTheme(JSON.parse(aString), aBaseURI, false);
} catch (e) {
@@ -176,7 +176,7 @@ this.LightweightThemeManager = {
}
},
- updateCurrentTheme: function LightweightThemeManager_updateCurrentTheme() {
+ updateCurrentTheme: function() {
try {
if (!_prefs.getBoolPref("update.enabled"))
return;
@@ -224,7 +224,7 @@ this.LightweightThemeManager = {
* @param aData
* The lightweight theme to switch to
*/
- themeChanged: function LightweightThemeManager_themeChanged(aData) {
+ themeChanged: function(aData) {
if (_previewTimer) {
_previewTimer.cancel();
_previewTimer = null;
@@ -251,7 +251,7 @@ this.LightweightThemeManager = {
* Starts the Addons provider and enables the new lightweight theme if
* necessary.
*/
- startup: function LightweightThemeManager_startup() {
+ startup: function() {
if (Services.prefs.prefHasUserValue(PREF_LWTHEME_TO_SELECT)) {
let id = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
if (id)
@@ -267,7 +267,7 @@ this.LightweightThemeManager = {
/**
* Shuts down the provider.
*/
- shutdown: function LightweightThemeManager_shutdown() {
+ shutdown: function() {
_prefs.removeObserver("", _prefObserver);
},
@@ -283,7 +283,7 @@ this.LightweightThemeManager = {
* true if the newly enabled add-on will only become enabled after a
* restart
*/
- addonChanged: function LightweightThemeManager_addonChanged(aId, aType, aPendingRestart) {
+ addonChanged: function(aId, aType, aPendingRestart) {
if (aType != ADDON_TYPE)
return;
@@ -356,7 +356,7 @@ this.LightweightThemeManager = {
* @param aCallback
* A callback to pass the Addon to
*/
- getAddonByID: function LightweightThemeManager_getAddonByID(aId, aCallback) {
+ getAddonByID: function(aId, aCallback) {
let id = _getInternalID(aId);
if (!id) {
aCallback(null);
@@ -380,7 +380,7 @@ this.LightweightThemeManager = {
* @param aCallback
* A callback to pass an array of Addons to
*/
- getAddonsByTypes: function LightweightThemeManager_getAddonsByTypes(aTypes, aCallback) {
+ getAddonsByTypes: function(aTypes, aCallback) {
if (aTypes && aTypes.indexOf(ADDON_TYPE) == -1) {
aCallback([]);
return;
@@ -541,7 +541,7 @@ AddonWrapper.prototype = {
},
// Lightweight themes are always compatible
- isCompatibleWith: function AddonWrapper_isCompatibleWith(appVersion, platformVersion) {
+ isCompatibleWith: function(appVersion, platformVersion) {
return true;
},
@@ -708,7 +708,7 @@ function _notifyWindows(aThemeData) {
var _previewTimer;
var _previewTimerCallback = {
- notify: function _previewTimerCallback_notify() {
+ notify: function() {
LightweightThemeManager.resetPreview();
}
};
diff --git a/toolkit/mozapps/extensions/addonManager.js b/toolkit/mozapps/extensions/addonManager.js
index 731e70c6c..2628ea87b 100644
--- a/toolkit/mozapps/extensions/addonManager.js
+++ b/toolkit/mozapps/extensions/addonManager.js
@@ -53,7 +53,7 @@ function amManager() {
}
amManager.prototype = {
- observe: function AMC_observe(aSubject, aTopic, aData) {
+ observe: function(aSubject, aTopic, aData) {
if (aTopic == "addons-startup")
AddonManagerPrivate.startup();
},
@@ -61,7 +61,7 @@ amManager.prototype = {
/**
* @see amIAddonManager.idl
*/
- mapURIToAddonID: function AMC_mapURIToAddonID(uri, id) {
+ mapURIToAddonID: function(uri, id) {
id.value = AddonManager.mapURIToAddonID(uri);
return !!id.value;
},
@@ -69,19 +69,15 @@ amManager.prototype = {
/**
* @see amIWebInstaller.idl
*/
- isInstallEnabled: function AMC_isInstallEnabled(aMimetype, aReferer) {
+ isInstallEnabled: function(aMimetype, aReferer) {
return AddonManager.isInstallEnabled(aMimetype);
},
/**
* @see amIWebInstaller.idl
*/
- installAddonsFromWebpage: function AMC_installAddonsFromWebpage(aMimetype,
- aBrowser,
- aInstallingPrincipal,
- aUris, aHashes,
- aNames, aIcons,
- aCallback) {
+ installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal,
+ aUris, aHashes, aNames, aIcons, aCallback) {
if (aUris.length == 0)
return false;
@@ -112,22 +108,22 @@ amManager.prototype = {
installs.push(aInstall);
if (aCallback) {
aInstall.addListener({
- onDownloadCancelled: function buildNextInstall_onDownloadCancelled(aInstall) {
+ onDownloadCancelled: function(aInstall) {
callCallback(uri, USER_CANCELLED);
},
- onDownloadFailed: function buildNextInstall_onDownloadFailed(aInstall) {
+ onDownloadFailed: function(aInstall) {
if (aInstall.error == AddonManager.ERROR_CORRUPT_FILE)
callCallback(uri, CANT_READ_ARCHIVE);
else
callCallback(uri, DOWNLOAD_ERROR);
},
- onInstallFailed: function buildNextInstall_onInstallFailed(aInstall) {
+ onInstallFailed: function(aInstall) {
callCallback(uri, EXECUTION_ERROR);
},
- onInstallEnded: function buildNextInstall_onInstallEnded(aInstall, aStatus) {
+ onInstallEnded: function(aInstall, aStatus) {
callCallback(uri, SUCCESS);
}
});
@@ -144,7 +140,7 @@ amManager.prototype = {
return retval;
},
- notify: function AMC_notify(aTimer) {
+ notify: function(aTimer) {
AddonManagerPrivate.backgroundUpdateTimerHandler();
},
@@ -154,7 +150,7 @@ amManager.prototype = {
* Listens to requests from child processes for InstallTrigger
* activity, and sends back callbacks.
*/
- receiveMessage: function AMC_receiveMessage(aMessage) {
+ receiveMessage: function(aMessage) {
let payload = aMessage.data;
switch (aMessage.name) {
@@ -165,7 +161,7 @@ amManager.prototype = {
let callback = null;
if (payload.callbackID != -1) {
callback = {
- onInstallEnded: function ITP_callback(url, status) {
+ onInstallEnded: function(url, status) {
gParentMM.broadcastAsyncMessage(MSG_INSTALL_CALLBACK, {
callbackID: payload.callbackID,
url: url,
@@ -184,7 +180,7 @@ amManager.prototype = {
classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
_xpcom_factory: {
- createInstance: function AMC_createInstance(aOuter, aIid) {
+ createInstance: function(aOuter, aIid) {
if (aOuter != null)
throw Components.Exception("Component does not support aggregation",
Cr.NS_ERROR_NO_AGGREGATION);
diff --git a/toolkit/mozapps/extensions/amInstallTrigger.js b/toolkit/mozapps/extensions/amInstallTrigger.js
index a18fe84c4..5fc0e1717 100644
--- a/toolkit/mozapps/extensions/amInstallTrigger.js
+++ b/toolkit/mozapps/extensions/amInstallTrigger.js
@@ -203,7 +203,7 @@ InstallTrigger.prototype = {
return this.startSoftwareUpdate(url);
},
- _resolveURL: function (url) {
+ _resolveURL: function(url) {
return Services.io.newURI(url, null, this._url);
},
diff --git a/toolkit/mozapps/extensions/amWebInstallListener.js b/toolkit/mozapps/extensions/amWebInstallListener.js
index ac6e2495d..088f56640 100644
--- a/toolkit/mozapps/extensions/amWebInstallListener.js
+++ b/toolkit/mozapps/extensions/amWebInstallListener.js
@@ -89,7 +89,7 @@ Installer.prototype = {
/**
* Checks if all downloads are now complete and if so prompts to install.
*/
- checkAllDownloaded: function Installer_checkAllDownloaded() {
+ checkAllDownloaded: function() {
// Prevent re-entrancy caused by the confirmation dialog cancelling unwanted
// installs.
if (!this.isDownloading)
@@ -199,7 +199,7 @@ Installer.prototype = {
/**
* Checks if all installs are now complete and if so notifies observers.
*/
- checkAllInstalled: function Installer_checkAllInstalled() {
+ checkAllInstalled: function() {
var failed = [];
for (let install of this.downloads) {
@@ -225,32 +225,32 @@ Installer.prototype = {
this.installed = null;
},
- onDownloadCancelled: function Installer_onDownloadCancelled(aInstall) {
+ onDownloadCancelled: function(aInstall) {
aInstall.removeListener(this);
this.checkAllDownloaded();
},
- onDownloadFailed: function Installer_onDownloadFailed(aInstall) {
+ onDownloadFailed: function(aInstall) {
aInstall.removeListener(this);
this.checkAllDownloaded();
},
- onDownloadEnded: function Installer_onDownloadEnded(aInstall) {
+ onDownloadEnded: function(aInstall) {
this.checkAllDownloaded();
return false;
},
- onInstallCancelled: function Installer_onInstallCancelled(aInstall) {
+ onInstallCancelled: function(aInstall) {
aInstall.removeListener(this);
this.checkAllInstalled();
},
- onInstallFailed: function Installer_onInstallFailed(aInstall) {
+ onInstallFailed: function(aInstall) {
aInstall.removeListener(this);
this.checkAllInstalled();
},
- onInstallEnded: function Installer_onInstallEnded(aInstall) {
+ onInstallEnded: function(aInstall) {
aInstall.removeListener(this);
this.installed.push(aInstall);
@@ -272,7 +272,7 @@ extWebInstallListener.prototype = {
/**
* @see amIWebInstallListener.idl
*/
- onWebInstallDisabled: function extWebInstallListener_onWebInstallDisabled(aBrowser, aUri, aInstalls) {
+ onWebInstallDisabled: function(aBrowser, aUri, aInstalls) {
let info = {
browser: aBrowser,
originatingURI: aUri,
@@ -286,13 +286,13 @@ extWebInstallListener.prototype = {
/**
* @see amIWebInstallListener.idl
*/
- onWebInstallOriginBlocked: function extWebInstallListener_onWebInstallOriginBlocked(aBrowser, aUri, aInstalls) {
+ onWebInstallOriginBlocked: function(aBrowser, aUri, aInstalls) {
let info = {
browser: aBrowser,
originatingURI: aUri,
installs: aInstalls,
- install: function onWebInstallBlocked_install() {
+ install: function() {
},
QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
@@ -305,13 +305,13 @@ extWebInstallListener.prototype = {
/**
* @see amIWebInstallListener.idl
*/
- onWebInstallBlocked: function extWebInstallListener_onWebInstallBlocked(aBrowser, aUri, aInstalls) {
+ onWebInstallBlocked: function(aBrowser, aUri, aInstalls) {
let info = {
browser: aBrowser,
originatingURI: aUri,
installs: aInstalls,
- install: function onWebInstallBlocked_install() {
+ install: function() {
new Installer(this.browser, this.originatingURI, this.installs);
},
@@ -325,7 +325,7 @@ extWebInstallListener.prototype = {
/**
* @see amIWebInstallListener.idl
*/
- onWebInstallRequested: function extWebInstallListener_onWebInstallRequested(aBrowser, aUri, aInstalls) {
+ onWebInstallRequested: function(aBrowser, aUri, aInstalls) {
new Installer(aBrowser, aUri, aInstalls);
// We start the installs ourself