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

Side by Side Diff: messageResponder.js

Issue 29730608: Issue 6512 - Add notifications.clicked listener (Closed)
Patch Set: Created March 22, 2018, 2:42 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 | no next file » | 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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 10 matching lines...) Expand all
21 21
22 (function(global) 22 (function(global)
23 { 23 {
24 const {port} = require("messaging"); 24 const {port} = require("messaging");
25 const {Prefs} = require("prefs"); 25 const {Prefs} = require("prefs");
26 const {Utils} = require("utils"); 26 const {Utils} = require("utils");
27 const {FilterStorage} = require("filterStorage"); 27 const {FilterStorage} = require("filterStorage");
28 const {FilterNotifier} = require("filterNotifier"); 28 const {FilterNotifier} = require("filterNotifier");
29 const {defaultMatcher} = require("matcher"); 29 const {defaultMatcher} = require("matcher");
30 const {Notification: NotificationStorage} = require("notification"); 30 const {Notification: NotificationStorage} = require("notification");
31 const {getActiveNotification, shouldDisplay} = require("notificationHelper"); 31 const {getActiveNotification, shouldDisplay,
32 notificationClicked} = require("notificationHelper");
32 33
33 const { 34 const {
34 Filter, ActiveFilter, BlockingFilter, RegExpFilter 35 Filter, ActiveFilter, BlockingFilter, RegExpFilter
35 } = require("filterClasses"); 36 } = require("filterClasses");
36 const {Synchronizer} = require("synchronizer"); 37 const {Synchronizer} = require("synchronizer");
37 38
38 const info = require("info"); 39 const info = require("info");
39 const { 40 const {
40 Subscription, 41 Subscription,
41 DownloadableSubscription, 42 DownloadableSubscription,
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (!notification || 368 if (!notification ||
368 "displayMethod" in message && 369 "displayMethod" in message &&
369 !shouldDisplay(message.displayMethod, notification.type)) 370 !shouldDisplay(message.displayMethod, notification.type))
370 return; 371 return;
371 372
372 let texts = NotificationStorage.getLocalizedTexts(notification, 373 let texts = NotificationStorage.getLocalizedTexts(notification,
373 message.locale); 374 message.locale);
374 return Object.assign({texts}, notification); 375 return Object.assign({texts}, notification);
375 }); 376 });
376 377
378 port.on("notifications.clicked", (message, sender) =>
379 {
380 notificationClicked();
381 });
382
377 port.on("subscriptions.add", (message, sender) => 383 port.on("subscriptions.add", (message, sender) =>
378 { 384 {
379 let subscription = Subscription.fromURL(message.url); 385 let subscription = Subscription.fromURL(message.url);
380 if (message.confirm) 386 if (message.confirm)
381 { 387 {
382 if ("title" in message) 388 if ("title" in message)
383 subscription.title = message.title; 389 subscription.title = message.title;
384 if ("homepage" in message) 390 if ("homepage" in message)
385 subscription.homepage = message.homepage; 391 subscription.homepage = message.homepage;
386 392
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 if (message.url) 462 if (message.url)
457 subscriptions = [Subscription.fromURL(message.url)]; 463 subscriptions = [Subscription.fromURL(message.url)];
458 464
459 for (let subscription of subscriptions) 465 for (let subscription of subscriptions)
460 { 466 {
461 if (subscription instanceof DownloadableSubscription) 467 if (subscription instanceof DownloadableSubscription)
462 Synchronizer.execute(subscription, true); 468 Synchronizer.execute(subscription, true);
463 } 469 }
464 }); 470 });
465 })(this); 471 })(this);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld