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

Unified Diff: mobile/android/thirdparty/org/adblockplus/browser/AddOnBridge.java

Issue 29543774: Issue 2801 - Create 'Whitelisted websites' screen and add link to 'Ad blocking' screen (Closed)
Patch Set: Adjustments accordingly to Thomas's comments. Also, adjusting strings for multilocale build Created Sept. 19, 2017, 3:18 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: mobile/android/thirdparty/org/adblockplus/browser/AddOnBridge.java
===================================================================
--- a/mobile/android/thirdparty/org/adblockplus/browser/AddOnBridge.java
+++ b/mobile/android/thirdparty/org/adblockplus/browser/AddOnBridge.java
@@ -363,33 +363,42 @@ public class AddOnBridge
final String url)
{
Log.d(TAG, "queryIsLocal for " + url);
final Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("url", url);
callFunction(callback, "isLocal", parameters);
}
- public static void queryIsPageWhitelisted(final AdblockPlusApiCallback callback,
- final String url)
+ public static void queryWhitelistedWebsites(final AdblockPlusApiCallback callback)
{
- Log.d(TAG, "queryIsPageWhitelisted for " + url);
- final Map<String, Object> parameters = new HashMap<String, Object>();
- parameters.put("url", url);
- callFunction(callback, "isPageWhitelisted", parameters);
+ Log.d(TAG, "queryWhitelistedWebsites");
+ final Map<String, Object> parameters = new HashMap<>();
+ callFunction(callback, "getWhitelistedWebsites", parameters);
}
- public static void whitelistSite(final AdblockPlusApiCallback callback, final String url,
+ public static void queryIsWebsiteWhitelisted(final AdblockPlusApiCallback callback,
+ final String url)
+ {
+ Log.d(TAG, "queryIsWebsiteWhitelisted for " + url);
+ final Map<String, Object> parameters = new HashMap<String, Object>();
+ parameters.put("url", url);
+ parameters.put("host", UrlUtils.getHostFromUrl(url));
+ callFunction(callback, "isWebsiteWhitelisted", parameters);
+ }
+
+ public static void whitelistWebsite(final AdblockPlusApiCallback callback, String url,
final boolean whitelisted)
{
- Log.d(TAG, "whitelistSite for " + url);
+ Log.d(TAG, "whitelistWebsite for " + url);
final Map<String, Object> parameters = new HashMap<String, Object>();
- parameters.put("url", url);
+ parameters.put("url", UrlUtils.formatUrl(url));
+ parameters.put("host", UrlUtils.getHostFromUrl(url));
parameters.put("whitelisted", whitelisted);
- callFunction(callback, "whitelistSite", parameters, true);
+ callFunction(callback, "whitelistWebsite", parameters, true);
}
private static class AddOnRequest extends GeckoRequest
{
private final JSONObject value;
private final AdblockPlusApiCallback apiCallback;
AddOnRequest(final JSONObject value, final AdblockPlusApiCallback callback)

Powered by Google App Engine
This is Rietveld