upgrade deps
This commit is contained in:
+4
-4
@@ -22,7 +22,7 @@ import mozilla.components.concept.engine.EngineView
|
||||
import mozilla.components.feature.app.links.AppLinksFeature
|
||||
import mozilla.components.feature.downloads.DownloadsFeature
|
||||
import mozilla.components.feature.downloads.manager.FetchDownloadManager
|
||||
import mozilla.components.feature.downloads.temporary.ShareDownloadFeature
|
||||
import mozilla.components.feature.downloads.temporary.ShareResourceFeature
|
||||
import mozilla.components.feature.media.fullscreen.MediaSessionFullscreenFeature
|
||||
import mozilla.components.feature.privatemode.feature.SecureWindowFeature
|
||||
import mozilla.components.feature.prompts.PromptFeature
|
||||
@@ -48,7 +48,7 @@ import mozilla.components.support.locale.ActivityContextWrapper
|
||||
@SuppressWarnings("LargeClass")
|
||||
abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, ActivityResultHandler {
|
||||
private val sessionFeature = ViewBoundFeatureWrapper<SessionFeature>()
|
||||
private val shareDownloadsFeature = ViewBoundFeatureWrapper<ShareDownloadFeature>()
|
||||
private val shareResourceFeature = ViewBoundFeatureWrapper<ShareResourceFeature>()
|
||||
private val downloadsFeature = ViewBoundFeatureWrapper<DownloadsFeature>()
|
||||
private val appLinksFeature = ViewBoundFeatureWrapper<AppLinksFeature>()
|
||||
private val promptFeature = ViewBoundFeatureWrapper<PromptFeature>()
|
||||
@@ -151,8 +151,8 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Activit
|
||||
view = view,
|
||||
)
|
||||
|
||||
shareDownloadsFeature.set(
|
||||
ShareDownloadFeature(
|
||||
shareResourceFeature.set(
|
||||
ShareResourceFeature(
|
||||
context = requireContext().applicationContext,
|
||||
httpClient = components.core.client,
|
||||
store = components.core.store,
|
||||
|
||||
+4
@@ -16,6 +16,8 @@ import eu.lensai.flutter_mozilla_components.pigeons.GeckoTabContentEvents
|
||||
import eu.lensai.flutter_mozilla_components.pigeons.ReaderViewController
|
||||
import mozilla.components.concept.engine.EngineView
|
||||
import mozilla.components.concept.engine.selection.SelectionActionDelegate
|
||||
import mozilla.components.feature.downloads.DefaultFileSizeFormatter
|
||||
import mozilla.components.feature.downloads.FileSizeFormatter
|
||||
import mozilla.components.support.base.android.NotificationsDelegate
|
||||
|
||||
class Components(private val context: Context,
|
||||
@@ -42,4 +44,6 @@ class Components(private val context: Context,
|
||||
notificationManagerCompat,
|
||||
)
|
||||
}
|
||||
|
||||
val fileSizeFormatter: FileSizeFormatter by lazy { DefaultFileSizeFormatter(context) }
|
||||
}
|
||||
+3
@@ -103,6 +103,7 @@ class WebExtensionPromptFeature(
|
||||
addon = addon,
|
||||
promptRequest = promptRequest,
|
||||
permissions = promptRequest.permissions,
|
||||
origins = promptRequest.origins,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -156,12 +157,14 @@ class WebExtensionPromptFeature(
|
||||
addon: Addon,
|
||||
promptRequest: WebExtensionPromptRequest.AfterInstallation.Permissions,
|
||||
permissions: List<String> = emptyList(),
|
||||
origins: List<String> = emptyList(),
|
||||
forOptionalPermissions: Boolean = false,
|
||||
) {
|
||||
if (!isInstallationInProgress && !hasExistingPermissionDialogFragment()) {
|
||||
val dialog = PermissionsDialogFragment.newInstance(
|
||||
addon = addon,
|
||||
permissions = permissions,
|
||||
origins = origins,
|
||||
forOptionalPermissions = forOptionalPermissions,
|
||||
onPositiveButtonClicked = { _, privateBrowsingAllowed ->
|
||||
handlePermissions(
|
||||
|
||||
+5
-14
@@ -7,7 +7,8 @@ import eu.lensai.flutter_mozilla_components.pigeons.GeckoDownloadsApi
|
||||
import eu.lensai.flutter_mozilla_components.pigeons.ShareInternetResourceState
|
||||
import mozilla.components.browser.state.action.ContentAction
|
||||
import mozilla.components.browser.state.action.CopyInternetResourceAction
|
||||
import mozilla.components.browser.state.action.ShareInternetResourceAction
|
||||
import mozilla.components.browser.state.action.ShareResourceAction
|
||||
import mozilla.components.browser.state.state.content.ShareResourceState
|
||||
import java.util.UUID
|
||||
|
||||
class GeckoDownloadsApiImpl : GeckoDownloadsApi {
|
||||
@@ -29,11 +30,11 @@ class GeckoDownloadsApiImpl : GeckoDownloadsApi {
|
||||
}
|
||||
|
||||
override fun shareInternetResource(tabId: String, state: ShareInternetResourceState) {
|
||||
components.core.store.dispatch(ShareInternetResourceAction.AddShareAction(tabId, state.toMozillaShareInternetResourceState()))
|
||||
components.core.store.dispatch(ShareResourceAction.AddShareAction(tabId, state.toMozillaShareInternetResourceState()))
|
||||
}
|
||||
|
||||
private fun ShareInternetResourceState.toMozillaShareInternetResourceState(): mozilla.components.browser.state.state.content.ShareInternetResourceState {
|
||||
return mozilla.components.browser.state.state.content.ShareInternetResourceState(
|
||||
private fun ShareInternetResourceState.toMozillaShareInternetResourceState(): ShareResourceState.InternetResource {
|
||||
return ShareResourceState.InternetResource(
|
||||
url = url,
|
||||
contentType = contentType,
|
||||
private = private,
|
||||
@@ -42,16 +43,6 @@ class GeckoDownloadsApiImpl : GeckoDownloadsApi {
|
||||
)
|
||||
}
|
||||
|
||||
fun mozilla.components.browser.state.state.content.ShareInternetResourceState.toPigeonShareInternetResourceState(): eu.lensai.flutter_mozilla_components.pigeons.ShareInternetResourceState {
|
||||
return eu.lensai.flutter_mozilla_components.pigeons.ShareInternetResourceState(
|
||||
url = url,
|
||||
contentType = contentType,
|
||||
private = private,
|
||||
referrerUrl = referrerUrl
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
private fun DownloadState.toMozillaDownloadState(): mozilla.components.browser.state.state.content.DownloadState {
|
||||
return mozilla.components.browser.state.state.content.DownloadState(
|
||||
url = url,
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ import mozilla.components.concept.engine.webextension.MessageHandler
|
||||
import mozilla.components.concept.engine.webextension.Port
|
||||
import mozilla.components.concept.engine.webextension.WebExtensionRuntime
|
||||
import mozilla.components.support.base.log.logger.Logger
|
||||
import mozilla.components.support.webextensions.WebExtensionController
|
||||
import mozilla.components.support.webextensions.BuiltInWebExtensionController
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.mozilla.gecko.util.ThreadUtils.runOnUiThread
|
||||
@@ -30,7 +30,7 @@ object BrowserExtensionFeature {
|
||||
|
||||
@VisibleForTesting
|
||||
// This is an internal var to make it mutable for unit testing purposes only
|
||||
internal var extensionController = WebExtensionController(
|
||||
internal var extensionController = BuiltInWebExtensionController(
|
||||
PREF_MANAGER_REPORTER_EXTENSION_ID,
|
||||
PREF_MANAGER_REPORTER_EXTENSION_URL,
|
||||
PREF_MANAGER_REPORTER_MESSAGING_ID
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import mozilla.components.concept.engine.webextension.MessageHandler
|
||||
import mozilla.components.concept.engine.webextension.Port
|
||||
import mozilla.components.concept.engine.webextension.WebExtensionRuntime
|
||||
import mozilla.components.support.base.log.logger.Logger
|
||||
import mozilla.components.support.webextensions.WebExtensionController
|
||||
import mozilla.components.support.webextensions.BuiltInWebExtensionController
|
||||
import org.json.JSONObject
|
||||
|
||||
object ContainerProxyFeature {
|
||||
@@ -26,7 +26,7 @@ object ContainerProxyFeature {
|
||||
|
||||
@VisibleForTesting
|
||||
// This is an internal var to make it mutable for unit testing purposes only
|
||||
internal var extensionController = WebExtensionController(
|
||||
internal var extensionController = BuiltInWebExtensionController(
|
||||
CONTAINER_PROXY_REPORTER_EXTENSION_ID,
|
||||
CONTAINER_PROXY_REPORTER_EXTENSION_URL,
|
||||
CONTAINER_PROXY_REPORTER_MESSAGING_ID,
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import mozilla.components.concept.engine.webextension.MessageHandler
|
||||
import mozilla.components.concept.engine.webextension.Port
|
||||
import mozilla.components.concept.engine.webextension.WebExtensionRuntime
|
||||
import mozilla.components.support.base.log.logger.Logger
|
||||
import mozilla.components.support.webextensions.WebExtensionController
|
||||
import mozilla.components.support.webextensions.BuiltInWebExtensionController
|
||||
import org.json.JSONObject
|
||||
|
||||
interface ResultConsumer<T> {
|
||||
@@ -35,7 +35,7 @@ object CookieManagerFeature {
|
||||
|
||||
@VisibleForTesting
|
||||
// This is an internal var to make it mutable for unit testing purposes only
|
||||
internal var extensionController = WebExtensionController(
|
||||
internal var extensionController = BuiltInWebExtensionController(
|
||||
COOKIE_MANAGER_REPORTER_EXTENSION_ID,
|
||||
COOKIE_MANAGER_REPORTER_EXTENSION_URL,
|
||||
COOKIE_MANAGER_REPORTER_MESSAGING_ID,
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import mozilla.components.concept.engine.webextension.MessageHandler
|
||||
import mozilla.components.concept.engine.webextension.Port
|
||||
import mozilla.components.concept.engine.webextension.WebExtensionRuntime
|
||||
import mozilla.components.support.base.log.logger.Logger
|
||||
import mozilla.components.support.webextensions.WebExtensionController
|
||||
import mozilla.components.support.webextensions.BuiltInWebExtensionController
|
||||
import org.json.JSONObject
|
||||
|
||||
object PrefManagerFeature {
|
||||
@@ -26,7 +26,7 @@ object PrefManagerFeature {
|
||||
|
||||
@VisibleForTesting
|
||||
// This is an internal var to make it mutable for unit testing purposes only
|
||||
internal var extensionController = WebExtensionController(
|
||||
internal var extensionController = BuiltInWebExtensionController(
|
||||
PREF_MANAGER_REPORTER_EXTENSION_ID,
|
||||
PREF_MANAGER_REPORTER_EXTENSION_URL,
|
||||
PREF_MANAGER_REPORTER_MESSAGING_ID,
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import mozilla.components.support.ktx.android.org.json.tryGetInt
|
||||
import mozilla.components.support.ktx.android.org.json.tryGetString
|
||||
import mozilla.components.support.ktx.kotlinx.coroutines.flow.filterChanged
|
||||
import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifAnyChanged
|
||||
import mozilla.components.support.webextensions.WebExtensionController
|
||||
import mozilla.components.support.webextensions.BuiltInWebExtensionController
|
||||
import org.json.JSONObject
|
||||
|
||||
class ReadabilityExtractFeature(
|
||||
@@ -61,7 +61,7 @@ class ReadabilityExtractFeature(
|
||||
private var sessionScope: CoroutineScope? = null
|
||||
private var historyScope: CoroutineScope? = null
|
||||
|
||||
private var extensionController = WebExtensionController(
|
||||
private var extensionController = BuiltInWebExtensionController(
|
||||
READER_EXTRACT_EXTENSION_ID,
|
||||
READER_EXTRACT_EXTENSION_URL,
|
||||
READER_EXTRACT_CONTENT_PORT,
|
||||
|
||||
+2
@@ -3,6 +3,7 @@ package eu.lensai.flutter_mozilla_components.services
|
||||
import eu.lensai.flutter_mozilla_components.GlobalComponents
|
||||
import mozilla.components.browser.state.store.BrowserStore
|
||||
import mozilla.components.feature.downloads.AbstractFetchDownloadService
|
||||
import mozilla.components.feature.downloads.FileSizeFormatter
|
||||
import mozilla.components.support.base.android.NotificationsDelegate
|
||||
|
||||
class DownloadService : AbstractFetchDownloadService() {
|
||||
@@ -13,4 +14,5 @@ class DownloadService : AbstractFetchDownloadService() {
|
||||
override val httpClient by lazy { components.core.client }
|
||||
override val store: BrowserStore by lazy { components.core.store }
|
||||
override val notificationsDelegate: NotificationsDelegate by lazy { components.notificationsDelegate }
|
||||
override val fileSizeFormatter: FileSizeFormatter by lazy { components.fileSizeFormatter }
|
||||
}
|
||||
Reference in New Issue
Block a user