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

Unified Diff: jni/abpEngine.cpp

Issue 5431458994847744: Automatically enable acceptable ads and notify the user about it (Closed)
Patch Set: Created Nov. 26, 2013, 10:39 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
Index: jni/abpEngine.cpp
===================================================================
--- a/jni/abpEngine.cpp
+++ b/jni/abpEngine.cpp
@@ -41,6 +41,10 @@
JNIEXPORT void JNICALL Java_org_adblockplus_android_ABPEngine_refreshSubscription(JNIEnv *pEnv, jobject, jstring url);
JNIEXPORT void JNICALL Java_org_adblockplus_android_ABPEngine_actualizeSubscriptionStatus(JNIEnv *pEnv, jobject, jstring url);
JNIEXPORT void JNICALL Java_org_adblockplus_android_ABPEngine_setAcceptableAdsEnabled(JNIEnv *pEnv, jobject, jboolean enabled);
+ JNIEXPORT void JNICALL Java_org_adblockplus_android_ABPEngine_setNotifiedAboutAcceptableAds(
+ JNIEnv* env, jobject object, jboolean notified);
+ JNIEXPORT jboolean JNICALL Java_org_adblockplus_android_ABPEngine_isNotifiedAboutAcceptableAds(
+ JNIEnv* env, jobject object);
JNIEXPORT jstring JNICALL Java_org_adblockplus_android_ABPEngine_getDocumentationLink(
JNIEnv *env, jobject object);
JNIEXPORT jboolean JNICALL Java_org_adblockplus_android_ABPEngine_matches(JNIEnv *pEnv, jobject, jstring url, jstring contentType, jstring documentUrl);
@@ -464,6 +468,19 @@
return env->NewStringUTF(documentationLink.c_str());
}
+JNIEXPORT void JNICALL Java_org_adblockplus_android_ABPEngine_setNotifiedAboutAcceptableAds(
+ JNIEnv* env, jobject object, jboolean notified)
+{
+ AdblockPlus::JsEnginePtr jsEngine = filterEngine->GetJsEngine();
+ filterEngine->SetPref("notified_about_acceptable_ads", jsEngine->NewValue(notified));
Wladimir Palant 2013/11/26 11:01:02 This won't do anything, prefs that aren't defined
Felix Dahlke 2013/11/26 13:59:31 Done. Wasn't aware of that. IMO, it doesn't make s
+}
+
+JNIEXPORT jboolean JNICALL Java_org_adblockplus_android_ABPEngine_isNotifiedAboutAcceptableAds(
+ JNIEnv* env, jobject object)
+{
+ return filterEngine->GetPref("notified_about_acceptable_ads")->AsBool();
+}
+
JNIEXPORT jboolean JNICALL Java_org_adblockplus_android_ABPEngine_matches(JNIEnv *pEnv, jobject, jstring url, jstring contentType, jstring documentUrl)
{
try
« no previous file with comments | « no previous file | src/org/adblockplus/android/ABPEngine.java » ('j') | src/org/adblockplus/android/Preferences.java » ('J')

Powered by Google App Engine
This is Rietveld