|
|
@ -16,6 +16,7 @@ import kotlinx.android.synthetic.main.fragment_browser.*
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.view.*
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.view.*
|
|
|
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
|
|
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
|
|
|
import mozilla.components.browser.session.Session
|
|
|
|
import mozilla.components.browser.session.Session
|
|
|
|
|
|
|
|
import mozilla.components.feature.app.links.AppLinksUseCases
|
|
|
|
import mozilla.components.feature.contextmenu.ContextMenuCandidate
|
|
|
|
import mozilla.components.feature.contextmenu.ContextMenuCandidate
|
|
|
|
import mozilla.components.feature.readerview.ReaderViewFeature
|
|
|
|
import mozilla.components.feature.readerview.ReaderViewFeature
|
|
|
|
import mozilla.components.feature.search.SearchFeature
|
|
|
|
import mozilla.components.feature.search.SearchFeature
|
|
|
@ -222,13 +223,21 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
|
|
|
|
override fun getContextMenuCandidates(
|
|
|
|
override fun getContextMenuCandidates(
|
|
|
|
context: Context,
|
|
|
|
context: Context,
|
|
|
|
view: View
|
|
|
|
view: View
|
|
|
|
): List<ContextMenuCandidate> = ContextMenuCandidate.defaultCandidates(
|
|
|
|
): List<ContextMenuCandidate> {
|
|
|
|
context,
|
|
|
|
val contextMenuCandidateAppLinksUseCases = AppLinksUseCases(
|
|
|
|
context.components.useCases.tabsUseCases,
|
|
|
|
requireContext(),
|
|
|
|
context.components.useCases.contextMenuUseCases,
|
|
|
|
{ true }
|
|
|
|
view,
|
|
|
|
)
|
|
|
|
FenixSnackbarDelegate(view)
|
|
|
|
|
|
|
|
)
|
|
|
|
return ContextMenuCandidate.defaultCandidates(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
context.components.useCases.tabsUseCases,
|
|
|
|
|
|
|
|
context.components.useCases.contextMenuUseCases,
|
|
|
|
|
|
|
|
view,
|
|
|
|
|
|
|
|
FenixSnackbarDelegate(view)
|
|
|
|
|
|
|
|
) + ContextMenuCandidate.createOpenInExternalAppCandidate(requireContext(),
|
|
|
|
|
|
|
|
contextMenuCandidateAppLinksUseCases)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
companion object {
|
|
|
|
private const val SHARED_TRANSITION_MS = 200L
|
|
|
|
private const val SHARED_TRANSITION_MS = 200L
|
|
|
|