No Issue: Add support for deleting individual tracking protection
exceptions on nightly.master
parent
f726b03792
commit
310da6c1ea
|
@ -58,4 +58,9 @@ object FeatureFlags {
|
||||||
* Enables the new language picker
|
* Enables the new language picker
|
||||||
*/
|
*/
|
||||||
val fenixLanguagePicker = Config.channel.isNightlyOrDebug
|
val fenixLanguagePicker = Config.channel.isNightlyOrDebug
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables deleting individual tracking protection exceptions.
|
||||||
|
*/
|
||||||
|
val deleteIndividualTrackingProtectionExceptions = Config.channel.isNightlyOrDebug
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import mozilla.components.concept.engine.content.blocking.TrackingProtectionExce
|
||||||
import mozilla.components.feature.session.TrackingProtectionUseCases
|
import mozilla.components.feature.session.TrackingProtectionUseCases
|
||||||
import mozilla.components.lib.state.ext.consumeFrom
|
import mozilla.components.lib.state.ext.consumeFrom
|
||||||
import org.mozilla.fenix.BrowserDirection
|
import org.mozilla.fenix.BrowserDirection
|
||||||
|
import org.mozilla.fenix.FeatureFlags
|
||||||
import org.mozilla.fenix.HomeActivity
|
import org.mozilla.fenix.HomeActivity
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.components.StoreProvider
|
import org.mozilla.fenix.components.StoreProvider
|
||||||
|
@ -76,8 +77,10 @@ class ExceptionsFragment : Fragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun deleteOneItem(item: TrackingProtectionException) {
|
private fun deleteOneItem(item: TrackingProtectionException) {
|
||||||
// We can't currently delete one item in this Exceptions list with a URL with the GV API
|
// This feature hasn't been uplifted yet.
|
||||||
// See https://github.com/mozilla-mobile/android-components/issues/4699
|
if (FeatureFlags.deleteIndividualTrackingProtectionExceptions) {
|
||||||
|
trackingProtectionUseCases.removeAllExceptions()
|
||||||
|
}
|
||||||
Log.e("Remove one exception", "$item")
|
Log.e("Remove one exception", "$item")
|
||||||
reloadExceptions()
|
reloadExceptions()
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,11 @@
|
||||||
package org.mozilla.fenix.exceptions.viewholders
|
package org.mozilla.fenix.exceptions.viewholders
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import kotlinx.android.synthetic.main.exception_item.view.*
|
import kotlinx.android.synthetic.main.exception_item.view.*
|
||||||
import mozilla.components.concept.engine.content.blocking.TrackingProtectionException
|
import mozilla.components.concept.engine.content.blocking.TrackingProtectionException
|
||||||
|
import org.mozilla.fenix.FeatureFlags
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.exceptions.ExceptionsInteractor
|
import org.mozilla.fenix.exceptions.ExceptionsInteractor
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
|
@ -38,6 +40,7 @@ class ExceptionsListItemViewHolder(
|
||||||
fun bind(item: TrackingProtectionException) {
|
fun bind(item: TrackingProtectionException) {
|
||||||
this.item = item
|
this.item = item
|
||||||
url.text = item.url
|
url.text = item.url
|
||||||
|
deleteButton.isVisible = FeatureFlags.deleteIndividualTrackingProtectionExceptions
|
||||||
updateFavIcon(item.url)
|
updateFavIcon(item.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue