diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index 7aa83991e2..392dc54588 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -58,6 +58,7 @@ import mozilla.components.feature.contextmenu.ContextMenuCandidate import mozilla.components.feature.contextmenu.ContextMenuFeature import mozilla.components.feature.downloads.DownloadsFeature import mozilla.components.feature.downloads.manager.FetchDownloadManager +import mozilla.components.feature.downloads.share.ShareDownloadFeature import mozilla.components.feature.intent.ext.EXTRA_SESSION_ID import mozilla.components.feature.media.fullscreen.MediaSessionFullscreenFeature import mozilla.components.feature.privatemode.feature.SecureWindowFeature @@ -161,6 +162,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Activit private val sessionFeature = ViewBoundFeatureWrapper() private val contextMenuFeature = ViewBoundFeatureWrapper() private val downloadsFeature = ViewBoundFeatureWrapper() + private val shareDownloadsFeature = ViewBoundFeatureWrapper() private val appLinksFeature = ViewBoundFeatureWrapper() private val promptsFeature = ViewBoundFeatureWrapper() private val findInPageIntegration = ViewBoundFeatureWrapper() @@ -429,6 +431,13 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Activit ) } + val shareDownloadFeature = ShareDownloadFeature( + context = context.applicationContext, + httpClient = context.components.core.client, + store = store, + tabId = customTabSessionId + ) + val downloadFeature = DownloadsFeature( context.applicationContext, store = store, @@ -508,6 +517,12 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Activit store, view, context, toolbarHeight ) + shareDownloadsFeature.set( + shareDownloadFeature, + owner = this, + view = view + ) + downloadsFeature.set( downloadFeature, owner = this,