Update customtabs service
parent
a684cfe913
commit
c958cc048a
|
@ -506,6 +506,7 @@ dependencies {
|
|||
implementation Deps.mozilla_feature_webnotifications
|
||||
implementation Deps.mozilla_feature_webcompat_reporter
|
||||
|
||||
implementation Deps.mozilla_service_digitalassetlinks
|
||||
implementation Deps.mozilla_service_experiments
|
||||
implementation Deps.mozilla_service_sync_logins
|
||||
implementation Deps.mozilla_service_firefox_accounts
|
||||
|
|
|
@ -61,7 +61,7 @@ class Components(private val context: Context) {
|
|||
core.sessionManager,
|
||||
useCases.sessionUseCases,
|
||||
useCases.searchUseCases,
|
||||
core.client,
|
||||
core.relationChecker,
|
||||
core.customTabsStore,
|
||||
migrationStore,
|
||||
core.webAppManifestStorage
|
||||
|
|
|
@ -41,8 +41,11 @@ import mozilla.components.feature.webcompat.reporter.WebCompatReporterFeature
|
|||
import mozilla.components.feature.webnotifications.WebNotificationFeature
|
||||
import mozilla.components.lib.dataprotect.SecureAbove22Preferences
|
||||
import mozilla.components.lib.dataprotect.generateEncryptionKey
|
||||
import mozilla.components.service.digitalassetlinks.RelationChecker
|
||||
import mozilla.components.service.digitalassetlinks.api.DigitalAssetLinksApi
|
||||
import mozilla.components.service.sync.logins.SyncableLoginsStorage
|
||||
import org.mozilla.fenix.AppRequestInterceptor
|
||||
import org.mozilla.fenix.BuildConfig.DIGITAL_ASSET_LINKS_TOKEN
|
||||
import org.mozilla.fenix.Config
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
|
@ -136,6 +139,13 @@ class Core(private val context: Context) {
|
|||
*/
|
||||
val customTabsStore by lazy { CustomTabsServiceStore() }
|
||||
|
||||
/**
|
||||
* The [RelationChecker] checks Digital Asset Links relationships for Trusted Web Activities.
|
||||
*/
|
||||
val relationChecker: RelationChecker by lazy {
|
||||
DigitalAssetLinksApi(client, DIGITAL_ASSET_LINKS_TOKEN)
|
||||
}
|
||||
|
||||
/**
|
||||
* The session manager component provides access to a centralized registry of
|
||||
* all browser sessions (i.e. tabs). It is initialized here to persist and restore
|
||||
|
|
|
@ -6,7 +6,6 @@ package org.mozilla.fenix.components
|
|||
|
||||
import android.content.Context
|
||||
import mozilla.components.browser.session.SessionManager
|
||||
import mozilla.components.concept.fetch.Client
|
||||
import mozilla.components.feature.customtabs.CustomTabIntentProcessor
|
||||
import mozilla.components.feature.customtabs.store.CustomTabsServiceStore
|
||||
import mozilla.components.feature.intent.processing.TabIntentProcessor
|
||||
|
@ -15,9 +14,9 @@ import mozilla.components.feature.pwa.intent.TrustedWebActivityIntentProcessor
|
|||
import mozilla.components.feature.pwa.intent.WebAppIntentProcessor
|
||||
import mozilla.components.feature.search.SearchUseCases
|
||||
import mozilla.components.feature.session.SessionUseCases
|
||||
import mozilla.components.service.digitalassetlinks.RelationChecker
|
||||
import mozilla.components.support.migration.MigrationIntentProcessor
|
||||
import mozilla.components.support.migration.state.MigrationStore
|
||||
import org.mozilla.fenix.BuildConfig
|
||||
import org.mozilla.fenix.customtabs.FennecWebAppIntentProcessor
|
||||
import org.mozilla.fenix.home.intent.FennecBookmarkShortcutsIntentProcessor
|
||||
import org.mozilla.fenix.utils.Mockable
|
||||
|
@ -31,7 +30,7 @@ class IntentProcessors(
|
|||
private val sessionManager: SessionManager,
|
||||
private val sessionUseCases: SessionUseCases,
|
||||
private val searchUseCases: SearchUseCases,
|
||||
private val httpClient: Client,
|
||||
private val relationChecker: RelationChecker,
|
||||
private val customTabsStore: CustomTabsServiceStore,
|
||||
private val migrationStore: MigrationStore,
|
||||
private val manifestStorage: ManifestStorage
|
||||
|
@ -63,9 +62,8 @@ class IntentProcessors(
|
|||
TrustedWebActivityIntentProcessor(
|
||||
sessionManager = sessionManager,
|
||||
loadUrlUseCase = sessionUseCases.loadUrl,
|
||||
httpClient = httpClient,
|
||||
packageManager = context.packageManager,
|
||||
apiKey = BuildConfig.DIGITAL_ASSET_LINKS_TOKEN,
|
||||
relationChecker = relationChecker,
|
||||
store = customTabsStore
|
||||
),
|
||||
WebAppIntentProcessor(sessionManager, sessionUseCases.loadUrl, manifestStorage),
|
||||
|
|
|
@ -6,12 +6,10 @@ package org.mozilla.fenix.customtabs
|
|||
|
||||
import mozilla.components.concept.engine.Engine
|
||||
import mozilla.components.feature.customtabs.AbstractCustomTabsService
|
||||
import org.mozilla.fenix.BuildConfig.DIGITAL_ASSET_LINKS_TOKEN
|
||||
import org.mozilla.fenix.ext.components
|
||||
|
||||
class CustomTabsService : AbstractCustomTabsService() {
|
||||
override val engine: Engine by lazy { applicationContext.components.core.engine }
|
||||
override val customTabsServiceStore by lazy { applicationContext.components.core.customTabsStore }
|
||||
override val httpClient by lazy { applicationContext.components.core.client }
|
||||
override val apiKey: String? = DIGITAL_ASSET_LINKS_TOKEN
|
||||
override val engine: Engine by lazy { components.core.engine }
|
||||
override val customTabsServiceStore by lazy { components.core.customTabsStore }
|
||||
override val relationChecker by lazy { components.core.relationChecker }
|
||||
}
|
||||
|
|
|
@ -116,6 +116,8 @@ object Deps {
|
|||
const val mozilla_feature_webnotifications = "org.mozilla.components:feature-webnotifications:${Versions.mozilla_android_components}"
|
||||
const val mozilla_feature_webcompat_reporter = "org.mozilla.components:feature-webcompat-reporter:${Versions.mozilla_android_components}"
|
||||
|
||||
const val mozilla_service_digitalassetlinks =
|
||||
"org.mozilla.components:service-digitalassetlinks:${Versions.mozilla_android_components}"
|
||||
const val mozilla_service_experiments =
|
||||
"org.mozilla.components:service-experiments:${Versions.mozilla_android_components}"
|
||||
const val mozilla_service_sync_logins =
|
||||
|
|
Loading…
Reference in New Issue