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

Unified Diff: src/FilterEngine.cpp

Issue 5653480979038208: Issue 2325 - Add a way to set settings in libadblockplus for FRP and automatic updates (Closed)
Patch Set: Created April 17, 2015, 3:54 a.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
« lib/updater.js ('K') | « lib/updater.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
===================================================================
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -134,7 +134,7 @@
return GetProperty("url")->AsString() == subscription.GetProperty("url")->AsString();
}
-FilterEngine::FilterEngine(JsEnginePtr jsEngine)
+FilterEngine::FilterEngine(JsEnginePtr jsEngine, bool firstRunDisabled, bool autoUpdatesDisabled)
: jsEngine(jsEngine), initialized(false), firstRun(false), updateCheckId(0)
{
jsEngine->SetEventCallback("init", std::tr1::bind(&FilterEngine::InitDone,
@@ -144,6 +144,9 @@
// Lock the JS engine while we are loading scripts, no timeouts should fire
// until we are done.
const JsContext context(jsEngine);
+ jsEngine->Evaluate(std::string("var firstRunDisabled = ") + (firstRunDisabled ? "true;" : "false;"));
sergei 2015/04/21 12:35:24 Would it be better to add them at least as members
Eric 2015/05/15 19:36:13 Not particularly. Application info is a descriptio
+ jsEngine->Evaluate(std::string("var autoupdatesDisabled = ") + (autoUpdatesDisabled ? "true;" : "false;"));
Eric 2015/05/15 19:36:13 My suggestion to use name value pairs would change
+
for (int i = 0; !jsSources[i].empty(); i += 2)
jsEngine->Evaluate(jsSources[i + 1], jsSources[i]);
}
« lib/updater.js ('K') | « lib/updater.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld