2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

Update customtabs service

This commit is contained in:
Tiger Oakes 2020-06-24 09:55:22 -07:00 committed by Emily Kager
parent a684cfe913
commit c958cc048a
6 changed files with 20 additions and 11 deletions

View File

@ -506,6 +506,7 @@ dependencies {
implementation Deps.mozilla_feature_webnotifications implementation Deps.mozilla_feature_webnotifications
implementation Deps.mozilla_feature_webcompat_reporter implementation Deps.mozilla_feature_webcompat_reporter
implementation Deps.mozilla_service_digitalassetlinks
implementation Deps.mozilla_service_experiments implementation Deps.mozilla_service_experiments
implementation Deps.mozilla_service_sync_logins implementation Deps.mozilla_service_sync_logins
implementation Deps.mozilla_service_firefox_accounts implementation Deps.mozilla_service_firefox_accounts

View File

@ -61,7 +61,7 @@ class Components(private val context: Context) {
core.sessionManager, core.sessionManager,
useCases.sessionUseCases, useCases.sessionUseCases,
useCases.searchUseCases, useCases.searchUseCases,
core.client, core.relationChecker,
core.customTabsStore, core.customTabsStore,
migrationStore, migrationStore,
core.webAppManifestStorage core.webAppManifestStorage

View File

@ -41,8 +41,11 @@ import mozilla.components.feature.webcompat.reporter.WebCompatReporterFeature
import mozilla.components.feature.webnotifications.WebNotificationFeature import mozilla.components.feature.webnotifications.WebNotificationFeature
import mozilla.components.lib.dataprotect.SecureAbove22Preferences import mozilla.components.lib.dataprotect.SecureAbove22Preferences
import mozilla.components.lib.dataprotect.generateEncryptionKey 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 mozilla.components.service.sync.logins.SyncableLoginsStorage
import org.mozilla.fenix.AppRequestInterceptor import org.mozilla.fenix.AppRequestInterceptor
import org.mozilla.fenix.BuildConfig.DIGITAL_ASSET_LINKS_TOKEN
import org.mozilla.fenix.Config import org.mozilla.fenix.Config
import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R import org.mozilla.fenix.R
@ -136,6 +139,13 @@ class Core(private val context: Context) {
*/ */
val customTabsStore by lazy { CustomTabsServiceStore() } 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 * 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 * all browser sessions (i.e. tabs). It is initialized here to persist and restore

View File

@ -6,7 +6,6 @@ package org.mozilla.fenix.components
import android.content.Context import android.content.Context
import mozilla.components.browser.session.SessionManager import mozilla.components.browser.session.SessionManager
import mozilla.components.concept.fetch.Client
import mozilla.components.feature.customtabs.CustomTabIntentProcessor import mozilla.components.feature.customtabs.CustomTabIntentProcessor
import mozilla.components.feature.customtabs.store.CustomTabsServiceStore import mozilla.components.feature.customtabs.store.CustomTabsServiceStore
import mozilla.components.feature.intent.processing.TabIntentProcessor 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.pwa.intent.WebAppIntentProcessor
import mozilla.components.feature.search.SearchUseCases import mozilla.components.feature.search.SearchUseCases
import mozilla.components.feature.session.SessionUseCases import mozilla.components.feature.session.SessionUseCases
import mozilla.components.service.digitalassetlinks.RelationChecker
import mozilla.components.support.migration.MigrationIntentProcessor import mozilla.components.support.migration.MigrationIntentProcessor
import mozilla.components.support.migration.state.MigrationStore import mozilla.components.support.migration.state.MigrationStore
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.customtabs.FennecWebAppIntentProcessor import org.mozilla.fenix.customtabs.FennecWebAppIntentProcessor
import org.mozilla.fenix.home.intent.FennecBookmarkShortcutsIntentProcessor import org.mozilla.fenix.home.intent.FennecBookmarkShortcutsIntentProcessor
import org.mozilla.fenix.utils.Mockable import org.mozilla.fenix.utils.Mockable
@ -31,7 +30,7 @@ class IntentProcessors(
private val sessionManager: SessionManager, private val sessionManager: SessionManager,
private val sessionUseCases: SessionUseCases, private val sessionUseCases: SessionUseCases,
private val searchUseCases: SearchUseCases, private val searchUseCases: SearchUseCases,
private val httpClient: Client, private val relationChecker: RelationChecker,
private val customTabsStore: CustomTabsServiceStore, private val customTabsStore: CustomTabsServiceStore,
private val migrationStore: MigrationStore, private val migrationStore: MigrationStore,
private val manifestStorage: ManifestStorage private val manifestStorage: ManifestStorage
@ -63,9 +62,8 @@ class IntentProcessors(
TrustedWebActivityIntentProcessor( TrustedWebActivityIntentProcessor(
sessionManager = sessionManager, sessionManager = sessionManager,
loadUrlUseCase = sessionUseCases.loadUrl, loadUrlUseCase = sessionUseCases.loadUrl,
httpClient = httpClient,
packageManager = context.packageManager, packageManager = context.packageManager,
apiKey = BuildConfig.DIGITAL_ASSET_LINKS_TOKEN, relationChecker = relationChecker,
store = customTabsStore store = customTabsStore
), ),
WebAppIntentProcessor(sessionManager, sessionUseCases.loadUrl, manifestStorage), WebAppIntentProcessor(sessionManager, sessionUseCases.loadUrl, manifestStorage),

View File

@ -6,12 +6,10 @@ package org.mozilla.fenix.customtabs
import mozilla.components.concept.engine.Engine import mozilla.components.concept.engine.Engine
import mozilla.components.feature.customtabs.AbstractCustomTabsService import mozilla.components.feature.customtabs.AbstractCustomTabsService
import org.mozilla.fenix.BuildConfig.DIGITAL_ASSET_LINKS_TOKEN
import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.components
class CustomTabsService : AbstractCustomTabsService() { class CustomTabsService : AbstractCustomTabsService() {
override val engine: Engine by lazy { applicationContext.components.core.engine } override val engine: Engine by lazy { components.core.engine }
override val customTabsServiceStore by lazy { applicationContext.components.core.customTabsStore } override val customTabsServiceStore by lazy { components.core.customTabsStore }
override val httpClient by lazy { applicationContext.components.core.client } override val relationChecker by lazy { components.core.relationChecker }
override val apiKey: String? = DIGITAL_ASSET_LINKS_TOKEN
} }

View File

@ -116,6 +116,8 @@ object Deps {
const val mozilla_feature_webnotifications = "org.mozilla.components:feature-webnotifications:${Versions.mozilla_android_components}" 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_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 = const val mozilla_service_experiments =
"org.mozilla.components:service-experiments:${Versions.mozilla_android_components}" "org.mozilla.components:service-experiments:${Versions.mozilla_android_components}"
const val mozilla_service_sync_logins = const val mozilla_service_sync_logins =