OLD | NEW |
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 27 matching lines...) Expand all Loading... |
38 WhitelistedDomainsSettingsFragment.Listener | 38 WhitelistedDomainsSettingsFragment.Listener |
39 { | 39 { |
40 private static final String TAG = Utils.getTag(SettingsActivity.class); | 40 private static final String TAG = Utils.getTag(SettingsActivity.class); |
41 | 41 |
42 @Override | 42 @Override |
43 protected void onCreate(Bundle savedInstanceState) | 43 protected void onCreate(Bundle savedInstanceState) |
44 { | 44 { |
45 super.onCreate(savedInstanceState); | 45 super.onCreate(savedInstanceState); |
46 | 46 |
47 // retaining AdblockEngine asynchronously | 47 // retaining AdblockEngine asynchronously |
48 AdblockHelper.get().retain(true); | 48 AdblockHelper.get().getProvider().retain(true); |
49 | 49 |
50 insertGeneralFragment(); | 50 insertGeneralFragment(); |
51 } | 51 } |
52 | 52 |
53 private void insertGeneralFragment() | 53 private void insertGeneralFragment() |
54 { | 54 { |
55 getFragmentManager() | 55 getFragmentManager() |
56 .beginTransaction() | 56 .beginTransaction() |
57 .replace( | 57 .replace( |
58 android.R.id.content, | 58 android.R.id.content, |
(...skipping 11 matching lines...) Expand all Loading... |
70 .addToBackStack(WhitelistedDomainsSettingsFragment.class.getSimpleName()) | 70 .addToBackStack(WhitelistedDomainsSettingsFragment.class.getSimpleName()) |
71 .commit(); | 71 .commit(); |
72 } | 72 } |
73 | 73 |
74 // provider | 74 // provider |
75 | 75 |
76 @Override | 76 @Override |
77 public AdblockEngine getAdblockEngine() | 77 public AdblockEngine getAdblockEngine() |
78 { | 78 { |
79 // if it's retained asynchronously we have to wait until it's ready | 79 // if it's retained asynchronously we have to wait until it's ready |
80 AdblockHelper.get().waitForReady(); | 80 AdblockHelper.get().getProvider().waitForReady(); |
81 return AdblockHelper.get().getEngine(); | 81 return AdblockHelper.get().getProvider().getEngine(); |
82 } | 82 } |
83 | 83 |
84 @Override | 84 @Override |
85 public AdblockSettingsStorage getAdblockSettingsStorage() | 85 public AdblockSettingsStorage getAdblockSettingsStorage() |
86 { | 86 { |
87 return AdblockHelper.get().getStorage(); | 87 return AdblockHelper.get().getStorage(); |
88 } | 88 } |
89 | 89 |
90 // listener | 90 // listener |
91 | 91 |
(...skipping 15 matching lines...) Expand all Loading... |
107 AdblockSettings settings) | 107 AdblockSettings settings) |
108 { | 108 { |
109 // show error here if domain is invalid | 109 // show error here if domain is invalid |
110 return domain != null && domain.length() > 0; | 110 return domain != null && domain.length() > 0; |
111 } | 111 } |
112 | 112 |
113 @Override | 113 @Override |
114 protected void onDestroy() | 114 protected void onDestroy() |
115 { | 115 { |
116 super.onDestroy(); | 116 super.onDestroy(); |
117 AdblockHelper.get().release(); | 117 AdblockHelper.get().getProvider().release(); |
118 } | 118 } |
119 } | 119 } |
OLD | NEW |