From d775dae31d8a8cc9670b127989ad04c41946e369 Mon Sep 17 00:00:00 2001 From: Wesley Johnston Date: Wed, 1 Sep 2010 21:35:06 -0400 Subject: [PATCH] Bug 537180 - Fennec uses old blocklisting URL [r=dtownsend a=blocking-fennec] --- .../mozapps/extensions/nsBlocklistService.js | 11 +++++++ xpcom/system/nsIBlocklistService.idl | 30 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/toolkit/mozapps/extensions/nsBlocklistService.js b/toolkit/mozapps/extensions/nsBlocklistService.js index 4a82b3ba2a8..56ec9b55d69 100644 --- a/toolkit/mozapps/extensions/nsBlocklistService.js +++ b/toolkit/mozapps/extensions/nsBlocklistService.js @@ -866,6 +866,17 @@ Blocklist.prototype = { if (addonList.length == 0) return; + if ("@mozilla.org/addons/blocklist-prompt;1" in Cc) { + try { + let blockedPrompter = Cc["@mozilla.org/addons/blocklist-prompt;1"] + .getService(Ci.nsIBlocklistPrompt); + blockedPrompter.prompt(addonList); + } catch (e) { + LOG(e); + } + return; + } + var args = { restart: false, list: addonList diff --git a/xpcom/system/nsIBlocklistService.idl b/xpcom/system/nsIBlocklistService.idl index aebae33fc99..a829ff57dbc 100644 --- a/xpcom/system/nsIBlocklistService.idl +++ b/xpcom/system/nsIBlocklistService.idl @@ -40,6 +40,7 @@ #include "nsISupports.idl" interface nsIPluginTag; +interface nsIVariant; [scriptable, uuid(8439f9c0-da03-4260-8b21-dc635eed28fb)] interface nsIBlocklistService : nsISupports @@ -114,3 +115,32 @@ interface nsIBlocklistService : nsISupports [optional] in AString appVersion, [optional] in AString toolkitVersion); }; + +/** + * nsIBlocklistPrompt is used, if available, by the default implementation of + * nsIBlocklistService to display a confirmation UI to the user before blocking + * extensions/plugins. + */ +[scriptable, uuid(36f97f40-b0c9-11df-94e2-0800200c9a66)] +interface nsIBlocklistPrompt : nsISupports +{ + /** + * Prompt the user about newly blocked addons. The prompt is then resposible + * for soft-blocking any addons that need to be afterwards + * + * @param aAddons + * An array of addons and plugins that are blocked. These are javascript + * objects with properties: + * name - the plugin or extension name, + * version - the version of the extension or plugin, + * icon - the plugin or extension icon, + * disable - can be used by the nsIBlocklistPrompt to allows users to decide + * whether a soft-blocked add-on should be disabled, + * blocked - true if the item is hard-blocked, false otherwise, + * item - the nsIPluginTag or Addon object + * @param aCount + * The number of addons + */ + void prompt([array, size_is(aCount)] in nsIVariant aAddons, + [optional] in PRUint32 aCount); +};