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

Side by Side Diff: background.js

Issue 29338503: Issue 3823 - Adapt message names used by "Block element" feature for consistency (Closed)
Patch Set: Created March 17, 2016, 2:05 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | block.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // See http://crbug.com/68705. 47 // See http://crbug.com/68705.
48 var noStyleRulesHosts = ["mail.google.com", "mail.yahoo.com", "www.google.com"]; 48 var noStyleRulesHosts = ["mail.google.com", "mail.yahoo.com", "www.google.com"];
49 49
50 var htmlPages = new ext.PageMap(); 50 var htmlPages = new ext.PageMap();
51 51
52 var contextMenuItem = { 52 var contextMenuItem = {
53 title: ext.i18n.getMessage("block_element"), 53 title: ext.i18n.getMessage("block_element"),
54 contexts: ["image", "video", "audio"], 54 contexts: ["image", "video", "audio"],
55 onclick: function(page) 55 onclick: function(page)
56 { 56 {
57 page.sendMessage({type: "blockelement-context-menu-clicked"}); 57 page.sendMessage({type: "composer.content.contextMenuClicked"});
58 } 58 }
59 }; 59 };
60 60
61 // Adds or removes browser action icon according to options. 61 // Adds or removes browser action icon according to options.
62 function refreshIconAndContextMenu(page) 62 function refreshIconAndContextMenu(page)
63 { 63 {
64 var whitelisted = !!checkWhitelisted(page); 64 var whitelisted = !!checkWhitelisted(page);
65 updateIcon(page, whitelisted); 65 updateIcon(page, whitelisted);
66 66
67 // show or hide the context menu entry dependent on whether 67 // show or hide the context menu entry dependent on whether
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 msg.payload.sender = sender.page.id; 208 msg.payload.sender = sender.page.id;
209 if (msg.expectsResponse) 209 if (msg.expectsResponse)
210 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload)); 210 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload));
211 targetPage.sendMessage(msg.payload); 211 targetPage.sendMessage(msg.payload);
212 } 212 }
213 }); 213 });
214 214
215 // update icon when page changes location 215 // update icon when page changes location
216 ext.pages.onLoading.addListener(function(page) 216 ext.pages.onLoading.addListener(function(page)
217 { 217 {
218 page.sendMessage({type: "blockelement-finished"}); 218 page.sendMessage({type: "composer.content.finished"});
219 refreshIconAndContextMenu(page); 219 refreshIconAndContextMenu(page);
220 showNextNotificationForUrl(page.url); 220 showNextNotificationForUrl(page.url);
221 }); 221 });
OLDNEW
« no previous file with comments | « no previous file | block.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld