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

Side by Side Diff: background.js

Issue 5709671373471744: Unused icons for Chrome/Safari builds (Closed)
Patch Set: abp-128.png moved to chrome folder Created March 13, 2014, 3:21 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 | chrome/icons/abp-128.png » ('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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 { 338 {
339 var notification = webkitNotifications.createHTMLNotification("notificatio n.html"); 339 var notification = webkitNotifications.createHTMLNotification("notificatio n.html");
340 notification.show(); 340 notification.show();
341 notification.addEventListener("close", prepareNotificationIconAndPopup, fa lse); 341 notification.addEventListener("close", prepareNotificationIconAndPopup, fa lse);
342 return; 342 return;
343 } 343 }
344 344
345 var texts = Notification.getLocalizedTexts(notification); 345 var texts = Notification.getLocalizedTexts(notification);
346 var title = texts.title || ""; 346 var title = texts.title || "";
347 var message = texts.message ? texts.message.replace(/<\/?(a|strong)>/g, "") : ""; 347 var message = texts.message ? texts.message.replace(/<\/?(a|strong)>/g, "") : "";
348 var iconUrl = ext.getURL("icons/abp-128.png");
349 var hasLinks = activeNotification.links && activeNotification.links.length > 0; 348 var hasLinks = activeNotification.links && activeNotification.links.length > 0;
349 var iconUrl;
350 if (require("info").platform == "chromium")
351 iconUrl = ext.getURL("icons/abp-128.png");
352 else
353 iconUrl = ext.getURL("icon.png");
Sebastian Noack 2014/03/13 15:55:14 This shouldn't be necessary. The code below that u
saroyanm 2014/03/13 16:01:19 iconUrl is also used to generate webkit notificati
Sebastian Noack 2014/03/13 16:20:00 In that case I would prefer to keep that image red
saroyanm 2014/03/13 16:31:19 I see your point, in that case if you are okey wit
Sebastian Noack 2014/03/13 16:36:43 Yep, considering my assumptions were wrong, the pa
354
350 // Chrome on Linux does not fully support chrome.notifications yet 355 // Chrome on Linux does not fully support chrome.notifications yet
351 // https://code.google.com/p/chromium/issues/detail?id=291485 356 // https://code.google.com/p/chromium/issues/detail?id=291485
352 if (require("info").platform == "chromium" && 357 if (require("info").platform == "chromium" &&
353 "notifications" in chrome && 358 "notifications" in chrome &&
354 navigator.platform.indexOf("Linux") == -1) 359 navigator.platform.indexOf("Linux") == -1)
355 { 360 {
356 var opts = { 361 var opts = {
357 type: "basic", 362 type: "basic",
358 title: title, 363 title: title,
359 message: message, 364 message: message,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 tab.sendMessage({type: "clickhide-deactivate"}); 501 tab.sendMessage({type: "clickhide-deactivate"});
497 refreshIconAndContextMenu(tab); 502 refreshIconAndContextMenu(tab);
498 }); 503 });
499 504
500 setTimeout(function() 505 setTimeout(function()
501 { 506 {
502 var notificationToShow = Notification.getNextToShow(); 507 var notificationToShow = Notification.getNextToShow();
503 if (notificationToShow) 508 if (notificationToShow)
504 showNotification(notificationToShow); 509 showNotification(notificationToShow);
505 }, 3 * 60 * 1000); 510 }, 3 * 60 * 1000);
OLDNEW
« no previous file with comments | « no previous file | chrome/icons/abp-128.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld