Added BrowserThumbnails dependencies
parent
4349da7403
commit
63e529ac2b
|
@ -461,13 +461,14 @@ dependencies {
|
|||
implementation Deps.mozilla_browser_awesomebar
|
||||
implementation Deps.mozilla_feature_downloads
|
||||
implementation Deps.mozilla_browser_domains
|
||||
implementation Deps.mozilla_browser_tabstray
|
||||
implementation Deps.mozilla_browser_icons
|
||||
implementation Deps.mozilla_browser_menu
|
||||
implementation Deps.mozilla_browser_search
|
||||
implementation Deps.mozilla_browser_session
|
||||
implementation Deps.mozilla_browser_state
|
||||
implementation Deps.mozilla_browser_storage_sync
|
||||
implementation Deps.mozilla_browser_tabstray
|
||||
implementation Deps.mozilla_browser_thumbnails
|
||||
implementation Deps.mozilla_browser_toolbar
|
||||
|
||||
implementation Deps.mozilla_support_extensions
|
||||
|
|
|
@ -50,7 +50,8 @@ class Components(private val context: Context) {
|
|||
core.store,
|
||||
core.engine.settings,
|
||||
search.searchEngineManager,
|
||||
core.webAppShortcutManager
|
||||
core.webAppShortcutManager,
|
||||
core.thumbnailStorage
|
||||
)
|
||||
}
|
||||
val intentProcessors by lazy {
|
||||
|
|
|
@ -22,6 +22,7 @@ import mozilla.components.browser.state.state.BrowserState
|
|||
import mozilla.components.browser.state.store.BrowserStore
|
||||
import mozilla.components.browser.storage.sync.PlacesBookmarksStorage
|
||||
import mozilla.components.browser.storage.sync.PlacesHistoryStorage
|
||||
import mozilla.components.browser.thumbnails.storage.ThumbnailStorage
|
||||
import mozilla.components.concept.engine.DefaultSettings
|
||||
import mozilla.components.concept.engine.Engine
|
||||
import mozilla.components.concept.engine.mediaquery.PreferredColorScheme
|
||||
|
@ -216,6 +217,11 @@ class Core(private val context: Context) {
|
|||
|
||||
val tabCollectionStorage by lazy { TabCollectionStorage(context, sessionManager) }
|
||||
|
||||
/**
|
||||
* A storage component for persisting thumbnail images of tabs.
|
||||
*/
|
||||
val thumbnailStorage by lazy { ThumbnailStorage(context) }
|
||||
|
||||
val topSiteStorage by lazy { TopSiteStorage(context) }
|
||||
|
||||
val permissionStorage by lazy { PermissionStorage(context) }
|
||||
|
|
|
@ -8,6 +8,8 @@ import android.content.Context
|
|||
import mozilla.components.browser.search.SearchEngineManager
|
||||
import mozilla.components.browser.session.SessionManager
|
||||
import mozilla.components.browser.state.store.BrowserStore
|
||||
import mozilla.components.browser.thumbnails.ThumbnailsUseCases
|
||||
import mozilla.components.browser.thumbnails.storage.ThumbnailStorage
|
||||
import mozilla.components.concept.engine.Settings
|
||||
import mozilla.components.feature.app.links.AppLinksUseCases
|
||||
import mozilla.components.feature.contextmenu.ContextMenuUseCases
|
||||
|
@ -31,7 +33,8 @@ class UseCases(
|
|||
private val store: BrowserStore,
|
||||
private val engineSettings: Settings,
|
||||
private val searchEngineManager: SearchEngineManager,
|
||||
private val shortcutManager: WebAppShortcutManager
|
||||
private val shortcutManager: WebAppShortcutManager,
|
||||
private val thumbnailStorage: ThumbnailStorage
|
||||
) {
|
||||
/**
|
||||
* Use cases that provide engine interactions for a given browser session.
|
||||
|
@ -43,6 +46,16 @@ class UseCases(
|
|||
*/
|
||||
val tabsUseCases: TabsUseCases by lazy { TabsUseCases(sessionManager) }
|
||||
|
||||
/**
|
||||
* Use cases that provide tab thumbnail integration.
|
||||
*/
|
||||
val thumbnailUseCases: ThumbnailsUseCases by lazy {
|
||||
ThumbnailsUseCases(
|
||||
store,
|
||||
thumbnailStorage
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Use cases that provide search engine integration.
|
||||
*/
|
||||
|
|
|
@ -97,8 +97,10 @@ class TabTrayView(
|
|||
view.tabsTray,
|
||||
view.context.components.core.store,
|
||||
view.context.components.useCases.tabsUseCases,
|
||||
view.context.components.useCases.thumbnailUseCases,
|
||||
{ it.content.private == isPrivate },
|
||||
{ })
|
||||
{ }
|
||||
)
|
||||
|
||||
val tabs = if (isPrivate) {
|
||||
view.context.components.core.store.state.privateTabs
|
||||
|
|
|
@ -24,7 +24,8 @@ class TestComponents(private val context: Context) : Components(context) {
|
|||
core.store,
|
||||
core.engine.settings,
|
||||
search.searchEngineManager,
|
||||
core.webAppShortcutManager
|
||||
core.webAppShortcutManager,
|
||||
core.thumbnailStorage
|
||||
)
|
||||
}
|
||||
override val intentProcessors by lazy {
|
||||
|
|
|
@ -9,6 +9,7 @@ import io.mockk.every
|
|||
import io.mockk.mockk
|
||||
import mozilla.components.browser.session.SessionManager
|
||||
import mozilla.components.browser.state.store.BrowserStore
|
||||
import mozilla.components.browser.thumbnails.storage.ThumbnailStorage
|
||||
import mozilla.components.concept.engine.Engine
|
||||
import mozilla.components.concept.engine.Settings
|
||||
import mozilla.components.concept.fetch.Client
|
||||
|
@ -23,4 +24,5 @@ class TestCore(context: Context) : Core(context) {
|
|||
override val store = mockk<BrowserStore>()
|
||||
override val client = mockk<Client>()
|
||||
override val webAppShortcutManager = mockk<WebAppShortcutManager>()
|
||||
override val thumbnailStorage = mockk<ThumbnailStorage>()
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ object Deps {
|
|||
const val mozilla_browser_session = "org.mozilla.components:browser-session:${Versions.mozilla_android_components}"
|
||||
const val mozilla_browser_state = "org.mozilla.components:browser-state:${Versions.mozilla_android_components}"
|
||||
const val mozilla_browser_tabstray = "org.mozilla.components:browser-tabstray:${Versions.mozilla_android_components}"
|
||||
const val mozilla_browser_thumbnails = "org.mozilla.components:browser-thumbnails:${Versions.mozilla_android_components}"
|
||||
const val mozilla_browser_toolbar = "org.mozilla.components:browser-toolbar:${Versions.mozilla_android_components}"
|
||||
const val mozilla_browser_menu = "org.mozilla.components:browser-menu:${Versions.mozilla_android_components}"
|
||||
const val mozilla_browser_errorpages = "org.mozilla.components:browser-errorpages:${Versions.mozilla_android_components}"
|
||||
|
|
Loading…
Reference in New Issue