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

Side by Side Diff: messageResponder.js

Issue 29570584: Issue 5847 - Add prefs.set message handler (Closed)
Patch Set: Created Oct. 9, 2017, 2:30 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 { 331 {
332 sendMessage("pref", preference, Prefs[preference]); 332 sendMessage("pref", preference, Prefs[preference]);
333 }); 333 });
334 } 334 }
335 } 335 }
336 }); 336 });
337 337
338 port.on("prefs.toggle", (message, sender) => 338 port.on("prefs.toggle", (message, sender) =>
339 { 339 {
340 if (message.key == "notifications_ignoredcategories") 340 if (message.key == "notifications_ignoredcategories")
341 return NotificationStorage.toggleIgnoreCategory("*"); 341 return NotificationStorage.toggleIgnoreCategory("*", message.forceValue);
342 342
343 return Prefs[message.key] = !Prefs[message.key]; 343 return Prefs[message.key] = !Prefs[message.key];
344 }); 344 });
345 345
346 port.on("notifications.get", (message, sender) => 346 port.on("notifications.get", (message, sender) =>
347 { 347 {
348 let notification = getActiveNotification(); 348 let notification = getActiveNotification();
349 349
350 if (!notification || 350 if (!notification ||
351 "displayMethod" in message && 351 "displayMethod" in message &&
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 if (message.url) 429 if (message.url)
430 subscriptions = [Subscription.fromURL(message.url)]; 430 subscriptions = [Subscription.fromURL(message.url)];
431 431
432 for (let subscription of subscriptions) 432 for (let subscription of subscriptions)
433 { 433 {
434 if (subscription instanceof DownloadableSubscription) 434 if (subscription instanceof DownloadableSubscription)
435 Synchronizer.execute(subscription, true); 435 Synchronizer.execute(subscription, true);
436 } 436 }
437 }); 437 });
438 })(this); 438 })(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