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

Unified Diff: src/org/adblockplus/android/AdblockPlus.java

Issue 6245218638626816: Issue 1424 - Update libadblockplus-binaries to 6f79af14ad4e (Closed)
Patch Set: Use GetObjectClass instead of FindClass Created Sept. 22, 2014, 1:16 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: src/org/adblockplus/android/AdblockPlus.java
===================================================================
--- a/src/org/adblockplus/android/AdblockPlus.java
+++ b/src/org/adblockplus/android/AdblockPlus.java
@@ -29,6 +29,7 @@
import java.util.regex.Pattern;
import org.adblockplus.android.updater.AlarmReceiver;
+import org.adblockplus.libadblockplus.FilterEngine.ContentType;
import org.apache.commons.lang.StringUtils;
import android.app.ActivityManager;
@@ -339,33 +340,33 @@
if (!filteringEnabled)
return false;
- String contentType = null;
+ ContentType contentType = null;
if (accept != null)
{
if (accept.contains("text/css"))
- contentType = "STYLESHEET";
+ contentType = ContentType.STYLESHEET;
else if (accept.contains("image/*"))
- contentType = "IMAGE";
+ contentType = ContentType.IMAGE;
else if (accept.contains("text/html"))
- contentType = "SUBDOCUMENT";
+ contentType = ContentType.SUBDOCUMENT;
}
if (contentType == null)
{
if (RE_JS.matcher(url).find())
- contentType = "SCRIPT";
+ contentType = ContentType.SCRIPT;
else if (RE_CSS.matcher(url).find())
- contentType = "STYLESHEET";
+ contentType = ContentType.STYLESHEET;
else if (RE_IMAGE.matcher(url).find())
- contentType = "IMAGE";
+ contentType = ContentType.IMAGE;
else if (RE_FONT.matcher(url).find())
- contentType = "FONT";
+ contentType = ContentType.FONT;
else if (RE_HTML.matcher(url).find())
- contentType = "SUBDOCUMENT";
+ contentType = ContentType.SUBDOCUMENT;
}
if (contentType == null)
- contentType = "OTHER";
+ contentType = ContentType.OTHER;
final List<String> referrerChain = referrerMapping.buildReferrerChain(referrer);
final String[] referrerChainArray = referrerChain.toArray(new String[referrerChain.size()]);
« no previous file with comments | « src/org/adblockplus/android/ABPEngine.java ('k') | src/org/adblockplus/android/AndroidUpdateCheckDoneCallback.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld