1
0
Fork 0

For #11935 - Move BrowserThumbnails to BrowserFragment.

master
Kainalu Hagiwara 2020-08-12 13:12:36 -07:00
parent e42a8f5fa2
commit 2bdcbe5db9
2 changed files with 8 additions and 8 deletions

View File

@ -42,7 +42,6 @@ import mozilla.components.browser.state.selector.findTabOrCustomTabOrSelectedTab
import mozilla.components.browser.state.state.SessionState import mozilla.components.browser.state.state.SessionState
import mozilla.components.browser.state.state.content.DownloadState import mozilla.components.browser.state.state.content.DownloadState
import mozilla.components.browser.state.store.BrowserStore import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.browser.thumbnails.BrowserThumbnails
import mozilla.components.concept.engine.prompt.ShareData import mozilla.components.concept.engine.prompt.ShareData
import mozilla.components.feature.accounts.FxaCapability import mozilla.components.feature.accounts.FxaCapability
import mozilla.components.feature.accounts.FxaWebChannelFeature import mozilla.components.feature.accounts.FxaWebChannelFeature
@ -140,7 +139,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
private val appLinksFeature = ViewBoundFeatureWrapper<AppLinksFeature>() private val appLinksFeature = ViewBoundFeatureWrapper<AppLinksFeature>()
private val promptsFeature = ViewBoundFeatureWrapper<PromptFeature>() private val promptsFeature = ViewBoundFeatureWrapper<PromptFeature>()
private val findInPageIntegration = ViewBoundFeatureWrapper<FindInPageIntegration>() private val findInPageIntegration = ViewBoundFeatureWrapper<FindInPageIntegration>()
private val thumbnailsFeature = ViewBoundFeatureWrapper<BrowserThumbnails>()
private val toolbarIntegration = ViewBoundFeatureWrapper<ToolbarIntegration>() private val toolbarIntegration = ViewBoundFeatureWrapper<ToolbarIntegration>()
private val sitePermissionsFeature = ViewBoundFeatureWrapper<SitePermissionsFeature>() private val sitePermissionsFeature = ViewBoundFeatureWrapper<SitePermissionsFeature>()
private val fullScreenFeature = ViewBoundFeatureWrapper<FullScreenFeature>() private val fullScreenFeature = ViewBoundFeatureWrapper<FullScreenFeature>()
@ -281,12 +279,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
lifecycleOwner = viewLifecycleOwner lifecycleOwner = viewLifecycleOwner
) )
thumbnailsFeature.set(
feature = BrowserThumbnails(context, view.engineView, store),
owner = this,
view = view
)
toolbarIntegration.set( toolbarIntegration.set(
feature = browserToolbarView.toolbarIntegration, feature = browserToolbarView.toolbarIntegration,
owner = this, owner = this,

View File

@ -21,6 +21,7 @@ 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.browser.state.selector.findTab import mozilla.components.browser.state.selector.findTab
import mozilla.components.browser.thumbnails.BrowserThumbnails
import mozilla.components.browser.toolbar.BrowserToolbar import mozilla.components.browser.toolbar.BrowserToolbar
import mozilla.components.feature.app.links.AppLinksUseCases import mozilla.components.feature.app.links.AppLinksUseCases
import mozilla.components.feature.contextmenu.ContextMenuCandidate import mozilla.components.feature.contextmenu.ContextMenuCandidate
@ -55,6 +56,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
private val windowFeature = ViewBoundFeatureWrapper<WindowFeature>() private val windowFeature = ViewBoundFeatureWrapper<WindowFeature>()
private val searchFeature = ViewBoundFeatureWrapper<SearchFeature>() private val searchFeature = ViewBoundFeatureWrapper<SearchFeature>()
private val thumbnailsFeature = ViewBoundFeatureWrapper<BrowserThumbnails>()
private var readerModeAvailable = false private var readerModeAvailable = false
@ -107,6 +109,12 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
browserToolbarView.view.addPageAction(readerModeAction) browserToolbarView.view.addPageAction(readerModeAction)
thumbnailsFeature.set(
feature = BrowserThumbnails(context, view.engineView, components.core.store),
owner = this,
view = view
)
readerViewFeature.set( readerViewFeature.set(
feature = StrictMode.allowThreadDiskReads().resetPoliciesAfter { feature = StrictMode.allowThreadDiskReads().resetPoliciesAfter {
ReaderViewFeature( ReaderViewFeature(