1
0
Fork 0

No Issue: Add support for deleting individual tracking protection

exceptions on nightly.
master
Arturo Mejia 2020-01-22 11:55:53 -05:00 committed by Sawyer Blatz
parent f726b03792
commit 310da6c1ea
3 changed files with 13 additions and 2 deletions

View File

@ -58,4 +58,9 @@ object FeatureFlags {
* Enables the new language picker
*/
val fenixLanguagePicker = Config.channel.isNightlyOrDebug
/**
* Enables deleting individual tracking protection exceptions.
*/
val deleteIndividualTrackingProtectionExceptions = Config.channel.isNightlyOrDebug
}

View File

@ -16,6 +16,7 @@ import mozilla.components.concept.engine.content.blocking.TrackingProtectionExce
import mozilla.components.feature.session.TrackingProtectionUseCases
import mozilla.components.lib.state.ext.consumeFrom
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.components.StoreProvider
@ -76,8 +77,10 @@ class ExceptionsFragment : Fragment() {
}
private fun deleteOneItem(item: TrackingProtectionException) {
// We can't currently delete one item in this Exceptions list with a URL with the GV API
// See https://github.com/mozilla-mobile/android-components/issues/4699
// This feature hasn't been uplifted yet.
if (FeatureFlags.deleteIndividualTrackingProtectionExceptions) {
trackingProtectionUseCases.removeAllExceptions()
}
Log.e("Remove one exception", "$item")
reloadExceptions()
}

View File

@ -5,9 +5,11 @@
package org.mozilla.fenix.exceptions.viewholders
import android.view.View
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.exception_item.view.*
import mozilla.components.concept.engine.content.blocking.TrackingProtectionException
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.exceptions.ExceptionsInteractor
import org.mozilla.fenix.ext.components
@ -38,6 +40,7 @@ class ExceptionsListItemViewHolder(
fun bind(item: TrackingProtectionException) {
this.item = item
url.text = item.url
deleteButton.isVisible = FeatureFlags.deleteIndividualTrackingProtectionExceptions
updateFavIcon(item.url)
}