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

Unified Diff: chrome/content/ui/filters-subscriptionview.js

Issue 6337686776315904: Issue 394 - hit statistics tool data collection (Closed)
Patch Set: Rebase to changeset: 4095 Created Dec. 15, 2015, 6:09 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
Index: chrome/content/ui/filters-subscriptionview.js
===================================================================
--- a/chrome/content/ui/filters-subscriptionview.js
+++ b/chrome/content/ui/filters-subscriptionview.js
@@ -15,6 +15,8 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
+let {FilterHits} = require("filterHits");
+
/**
* Fills a list of filter groups and keeps it updated.
* @param {Element} list richlistbox element to be filled
@@ -324,4 +326,19 @@
FilterStorage.removeSubscription(subscription);
};
-window.addEventListener("load", ListManager.init, false);
+/**
+ * Toggles option for sending filter hit statistics.
+ */
+function toggleSendStats(/**Boolean*/ allow)
+{
+ if (!allow)
+ FilterHits.resetFilterHits();
Wladimir Palant 2016/02/15 12:25:39 Two notes: 1) I think this code is better placed
saroyanm 2016/02/19 17:38:09 Good point. Done.
+
+ Prefs.sendstats = allow;
+}
Wladimir Palant 2016/02/15 12:25:39 This code doesn't really belong here - all the log
saroyanm 2016/02/19 17:38:10 Done.
+
+window.addEventListener("load", function()
+{
+ ListManager.init();
+ E("sendStats").checked = Prefs.sendstats;
Wladimir Palant 2016/02/15 12:25:39 What if Prefs.savestats isn't set? I think we don'
saroyanm 2016/02/19 17:38:09 Good point, Done.
+}, false);

Powered by Google App Engine
This is Rietveld