You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.6 KiB
Kotlin
43 lines
1.6 KiB
Kotlin
5 years ago
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||
5 years ago
|
* 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/. */
|
||
5 years ago
|
|
||
5 years ago
|
package org.mozilla.fenix.components
|
||
|
|
||
|
import android.content.Context
|
||
|
import mozilla.components.browser.session.SessionManager
|
||
5 years ago
|
import mozilla.components.feature.customtabs.CustomTabIntentProcessor
|
||
5 years ago
|
import mozilla.components.feature.intent.processing.TabIntentProcessor
|
||
5 years ago
|
import mozilla.components.feature.search.SearchUseCases
|
||
|
import mozilla.components.feature.session.SessionUseCases
|
||
5 years ago
|
import org.mozilla.fenix.test.Mockable
|
||
5 years ago
|
|
||
|
/**
|
||
|
* Component group for miscellaneous components.
|
||
|
*/
|
||
5 years ago
|
@Mockable
|
||
5 years ago
|
class IntentProcessors(
|
||
5 years ago
|
private val context: Context,
|
||
|
private val sessionManager: SessionManager,
|
||
|
private val sessionUseCases: SessionUseCases,
|
||
|
private val searchUseCases: SearchUseCases
|
||
|
) {
|
||
|
/**
|
||
5 years ago
|
* Provides intent processing functionality for ACTION_VIEW and ACTION_SEND intents.
|
||
5 years ago
|
*/
|
||
|
val intentProcessor by lazy {
|
||
5 years ago
|
TabIntentProcessor(sessionManager, sessionUseCases.loadUrl, searchUseCases.newTabSearch, isPrivate = false)
|
||
5 years ago
|
}
|
||
5 years ago
|
|
||
5 years ago
|
/**
|
||
|
* Provides intent processing functionality for ACTION_VIEW and ACTION_SEND intents in private tabs.
|
||
|
*/
|
||
5 years ago
|
val privateIntentProcessor by lazy {
|
||
5 years ago
|
TabIntentProcessor(sessionManager, sessionUseCases.loadUrl, searchUseCases.newTabSearch, isPrivate = true)
|
||
|
}
|
||
|
|
||
|
val customTabIntentProcessor by lazy {
|
||
5 years ago
|
CustomTabIntentProcessor(sessionManager, sessionUseCases.loadUrl, context.resources)
|
||
5 years ago
|
}
|
||
5 years ago
|
}
|