LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 { | 197 { |
198 androidWebRequest = new AndroidWebRequest(engine.elemhideEnabled, true); | 198 androidWebRequest = new AndroidWebRequest(engine.elemhideEnabled, true); |
199 engine.webRequest = androidWebRequest; | 199 engine.webRequest = androidWebRequest; |
200 | 200 |
201 if (urlToResourceIdMap != null) | 201 if (urlToResourceIdMap != null) |
202 { | 202 { |
203 AndroidWebRequestResourceWrapper wrapper = new AndroidWebRequestResource
Wrapper( | 203 AndroidWebRequestResourceWrapper wrapper = new AndroidWebRequestResource
Wrapper( |
204 context, engine.webRequest, urlToResourceIdMap, resourceStorage); | 204 context, engine.webRequest, urlToResourceIdMap, resourceStorage); |
205 wrapper.setListener(new AndroidWebRequestResourceWrapper.Listener() | 205 wrapper.setListener(new AndroidWebRequestResourceWrapper.Listener() |
206 { | 206 { |
207 private AdblockEngine adblockEngine; | |
208 | |
209 AndroidWebRequestResourceWrapper.Listener init(AdblockEngine adblockEn
gine) | |
210 { | |
211 this.adblockEngine = adblockEngine; | |
212 return this; | |
213 } | |
214 | |
215 @Override | 207 @Override |
216 public void onIntercepted(String url, int resourceId) | 208 public void onIntercepted(String url, int resourceId) |
217 { | 209 { |
218 Log.d(TAG, "Force subscription update for intercepted URL " + url); | 210 Log.d(TAG, "Force subscription update for intercepted URL " + url); |
219 if (this.adblockEngine.filterEngine != null) | 211 if (engine.filterEngine != null) |
220 { | 212 { |
221 this.adblockEngine.filterEngine.updateFiltersAsync(url); | 213 engine.filterEngine.updateFiltersAsync(url); |
222 } | 214 } |
223 } | 215 } |
224 }.init(this.engine)); | 216 }); |
225 | 217 |
226 engine.webRequest = wrapper; | 218 engine.webRequest = wrapper; |
227 } | 219 } |
228 } | 220 } |
229 | 221 |
230 private void initCallbacks() | 222 private void initCallbacks() |
231 { | 223 { |
232 if (engine.updateAvailableCallback != null) | 224 if (engine.updateAvailableCallback != null) |
233 { | 225 { |
234 engine.filterEngine.setUpdateAvailableCallback(engine.updateAvailableCal
lback); | 226 engine.filterEngine.setUpdateAvailableCallback(engine.updateAvailableCal
lback); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 public void setWhitelistedDomains(List<String> domains) | 632 public void setWhitelistedDomains(List<String> domains) |
641 { | 633 { |
642 this.whitelistedDomains = domains; | 634 this.whitelistedDomains = domains; |
643 } | 635 } |
644 | 636 |
645 public List<String> getWhitelistedDomains() | 637 public List<String> getWhitelistedDomains() |
646 { | 638 { |
647 return whitelistedDomains; | 639 return whitelistedDomains; |
648 } | 640 } |
649 } | 641 } |
LEFT | RIGHT |