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

Unified Diff: messageResponder.js

Issue 5646124035604480: Issue 154 - Added UI for devtools panel on Chrome (Closed)
Patch Set: Addressed comments Created March 13, 2015, 1:07 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 | « ext/devtools.js ('k') | skin/devtools-panel.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: messageResponder.js
===================================================================
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -24,7 +24,6 @@
var FilterStorage = require("filterStorage").FilterStorage;
var FilterNotifier = require("filterNotifier").FilterNotifier;
var defaultMatcher = require("matcher").defaultMatcher;
- var BlockingFilter = require("filterClasses").BlockingFilter;
var Synchronizer = require("synchronizer").Synchronizer;
var subscriptionClasses = require("subscriptionClasses");
@@ -32,6 +31,10 @@
var DownloadableSubscription = subscriptionClasses.DownloadableSubscription;
var SpecialSubscription = subscriptionClasses.SpecialSubscription;
+ var filterClasses = require("filterClasses");
+ var Filter = filterClasses.Filter;
+ var BlockingFilter = filterClasses.BlockingFilter;
+
var subscriptionKeys = ["disabled", "homepage", "lastSuccess", "title", "url", "downloadStatus"];
function convertSubscription(subscription)
{
@@ -142,6 +145,12 @@
var filter = defaultMatcher.matchesAny(message.url, message.requestType, message.docDomain, message.thirdParty);
callback(filter instanceof BlockingFilter);
break;
+ case "filters.add":
+ FilterStorage.addFilter(Filter.fromText(message.filter));
+ break;
+ case "filters.remove":
+ FilterStorage.removeFilter(Filter.fromText(message.filter));
+ break;
case "subscriptions.toggle":
var subscription = Subscription.fromURL(message.url);
if (subscription.url in FilterStorage.knownSubscriptions && !subscription.disabled)
« no previous file with comments | « ext/devtools.js ('k') | skin/devtools-panel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld