2019-07-19 01:07:48 +02:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
package org.mozilla.fenix.exceptions
|
|
|
|
|
2020-01-22 04:07:50 +01:00
|
|
|
import mozilla.components.concept.engine.content.blocking.TrackingProtectionException
|
|
|
|
|
2019-07-19 01:07:48 +02:00
|
|
|
/**
|
|
|
|
* Interactor for the exceptions screen
|
|
|
|
* Provides implementations for the ExceptionsViewInteractor
|
|
|
|
*/
|
|
|
|
class ExceptionsInteractor(
|
|
|
|
private val learnMore: () -> Unit,
|
2020-01-22 04:07:50 +01:00
|
|
|
private val deleteOne: (TrackingProtectionException) -> Unit,
|
2019-07-19 01:07:48 +02:00
|
|
|
private val deleteAll: () -> Unit
|
|
|
|
) : ExceptionsViewInteractor {
|
|
|
|
override fun onLearnMore() {
|
|
|
|
learnMore.invoke()
|
|
|
|
}
|
|
|
|
|
|
|
|
override fun onDeleteAll() {
|
|
|
|
deleteAll.invoke()
|
|
|
|
}
|
|
|
|
|
2020-01-22 04:07:50 +01:00
|
|
|
override fun onDeleteOne(item: TrackingProtectionException) {
|
2019-07-19 01:07:48 +02:00
|
|
|
deleteOne.invoke(item)
|
|
|
|
}
|
|
|
|
}
|