Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/objectTabs.js

Issue 29338421: Issue 3499 - Use the new messaging API for object tabs (Closed)
Patch Set: Created March 16, 2016, 12:33 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/child/objectTabs.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/objectTabs.js
===================================================================
--- a/lib/objectTabs.js
+++ b/lib/objectTabs.js
@@ -16,16 +16,17 @@
*/
/**
* @fileOverview Code responsible for showing and hiding object tabs.
*/
let {Prefs} = require("prefs");
let {Utils} = require("utils");
+let {port} = require("messaging");
/**
* Random element class, to be used for object tabs displayed on top of the
* plugin content.
* @type string
*/
let classVisibleTop = null;
@@ -37,35 +38,35 @@ let classVisibleTop = null;
let classVisibleBottom = null;
/**
* Random element class, to be used for object tabs that are hidden.
* @type string
*/
let classHidden = null;
-Utils.addChildMessageListener("AdblockPlus:GetObjectTabsStatus", function()
+port.on("getObjectTabsStatus", function(message, sender)
{
let {UI} = require("ui");
return !!(Prefs.enabled && Prefs.frameobjects && UI.overlay && classHidden);
});
-Utils.addChildMessageListener("AdblockPlus:GetObjectTabsTexts", function()
+port.on("getObjectTabsTexts", function(message, sender)
{
let {UI} = require("ui");
return {
label: UI.overlay.attributes.objtabtext,
tooltip: UI.overlay.attributes.objtabtooltip,
classVisibleTop, classVisibleBottom, classHidden
};
});
-Utils.addChildMessageListener("AdblockPlus:BlockItem", function({request, nodesID})
+port.on("blockItem", function({request, nodesID}, sender)
{
let {UI} = require("ui");
UI.blockItem(UI.currentWindow, nodesID, request);
});
function init()
{
function processCSSData(event)
« no previous file with comments | « lib/child/objectTabs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld