diff options
Diffstat (limited to 'toolkit/mozapps/extensions')
-rw-r--r-- | toolkit/mozapps/extensions/GMPInstallManager.jsm | 50 | ||||
-rw-r--r-- | toolkit/mozapps/extensions/amWebInstallListener.js | 4 | ||||
-rw-r--r-- | toolkit/mozapps/extensions/content/xpinstallConfirm.js | 4 |
3 files changed, 3 insertions, 55 deletions
diff --git a/toolkit/mozapps/extensions/GMPInstallManager.jsm b/toolkit/mozapps/extensions/GMPInstallManager.jsm index b9ebe5d7e..fe4e2de10 100644 --- a/toolkit/mozapps/extensions/GMPInstallManager.jsm +++ b/toolkit/mozapps/extensions/GMPInstallManager.jsm @@ -38,8 +38,8 @@ XPCOMUtils.defineLazyGetter(this, "gCertUtils", function() { return temp; }); -XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel", - "resource://gre/modules/UpdateChannel.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils", + "resource://gre/modules/UpdateUtils.jsm"); /** * Number of milliseconds after which we need to cancel `checkForAddons`. @@ -190,33 +190,6 @@ XPCOMUtils.defineLazyGetter(this, "gOSVersion", function aus_gOSVersion() { return osVersion; }); -// This is copied directly from nsUpdateService.js -// It is used for calculating the URL string w/ var replacement. -// TODO: refactor this out somewhere else -XPCOMUtils.defineLazyGetter(this, "gABI", function aus_gABI() { - let abi = null; - try { - abi = Services.appinfo.XPCOMABI; - } - catch (e) { - LOG("gABI - XPCOM ABI unknown: updates are not possible."); - } -#ifdef XP_MACOSX - // Mac universal build should report a different ABI than either macppc - // or mactel. - let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"]. - getService(Ci.nsIMacUtils); - - if (macutils.isUniversalBinary) - abi += "-u-" + macutils.architecturesInBinary; -#ifdef MOZ_SHARK - // Disambiguate optimised and shark nightlies - abi += "-shark" -#endif -#endif - return abi; -}); - /** * Provides an easy API for downloading and installing GMP Addons */ @@ -241,24 +214,7 @@ GMPInstallManager.prototype = { log.info("Using url: " + url); } - url = - url.replace(/%PRODUCT%/g, Services.appinfo.name) - .replace(/%VERSION%/g, Services.appinfo.version) - .replace(/%BUILD_ID%/g, Services.appinfo.appBuildID) - .replace(/%BUILD_TARGET%/g, Services.appinfo.OS + "_" + gABI) - .replace(/%OS_VERSION%/g, gOSVersion); - if (/%LOCALE%/.test(url)) { - // TODO: Get the real local, does it actually matter for GMP plugins? - url = url.replace(/%LOCALE%/g, "en-US"); - } - url = - url.replace(/%CHANNEL%/g, UpdateChannel.get()) - .replace(/%PLATFORM_VERSION%/g, Services.appinfo.platformVersion) - .replace(/%DISTRIBUTION%/g, - GMPPrefs.get(GMPPrefs.KEY_APP_DISTRIBUTION)) - .replace(/%DISTRIBUTION_VERSION%/g, - GMPPrefs.get(GMPPrefs.KEY_APP_DISTRIBUTION_VERSION)) - .replace(/\+/g, "%2B"); + url = UpdateUtils.formatUpdateURL(url); log.info("Using url (with replacement): " + url); return url; }, diff --git a/toolkit/mozapps/extensions/amWebInstallListener.js b/toolkit/mozapps/extensions/amWebInstallListener.js index 088f56640..9b9c53f44 100644 --- a/toolkit/mozapps/extensions/amWebInstallListener.js +++ b/toolkit/mozapps/extensions/amWebInstallListener.js @@ -172,10 +172,6 @@ Installer.prototype = { args.wrappedJSObject = args; try { - Cc["@mozilla.org/base/telemetry;1"]. - getService(Ci.nsITelemetry). - getHistogramById("SECURITY_UI"). - add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL); let parentWindow = null; if (this.browser) { parentWindow = this.browser.ownerDocument.defaultView; diff --git a/toolkit/mozapps/extensions/content/xpinstallConfirm.js b/toolkit/mozapps/extensions/content/xpinstallConfirm.js index 5660cdaaf..29be5f5e9 100644 --- a/toolkit/mozapps/extensions/content/xpinstallConfirm.js +++ b/toolkit/mozapps/extensions/content/xpinstallConfirm.js @@ -179,10 +179,6 @@ XPInstallConfirm.init = function() XPInstallConfirm.onOK = function() { - Components.classes["@mozilla.org/base/telemetry;1"]. - getService(Components.interfaces.nsITelemetry). - getHistogramById("SECURITY_UI"). - add(Components.interfaces.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH); // Perform the install or cancel after the window has unloaded XPInstallConfirm._installOK = true; return true; |