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

Side by Side Diff: src/org/adblockplus/android/ABPEngine.java

Issue 11172036: ABP/Android libadblockplus integration (Closed)
Patch Set: Created July 22, 2013, 8:52 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 package org.adblockplus.android;
19
20 import android.content.Context;
21 import android.content.Intent;
22
23 public class ABPEngine
24 {
25 private final static String TAG = "ABPEngine";
26
27 private Context context;
28
29 public ABPEngine(Context context, String basePath)
30 {
31 this.context = context;
32 initialize(basePath);
33 }
34
35 public void onFilterChanged(String url, String status, long time)
36 {
37 context.sendBroadcast(new Intent(AdblockPlus.BROADCAST_SUBSCRIPTION_STATUS). putExtra("url", url).putExtra("status", status).putExtra("time", time));
38 }
39
40 private native void initialize(String basePath);
41
42 public native void release();
43
44 public native boolean isFirstRun();
45
46 public native Subscription[] getListedSubscriptions();
47
48 public native Subscription[] getRecommendedSubscriptions();
49
50 public native void addSubscription(String url);
51
52 public native void removeSubscription(String url);
53
54 public native void refreshSubscription(String url);
55
56 public native void actualizeSubscriptionStatus(String url);
57
58 public native boolean matches(String url, String contentType, String documentU rl);
59
60 public native String[] getSelectorsForDomain(String domain);
61
62 static
63 {
64 System.loadLibrary("abpEngine");
65 }
66 }
OLDNEW

Powered by Google App Engine
This is Rietveld