2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

For #14212: Pass historyStorage to ToolbarView

This commit is contained in:
Michael Debertol 2020-08-27 16:32:17 +02:00 committed by Jeff Boek
parent cc8aa1f381
commit 4142c36820

View File

@ -37,6 +37,7 @@ import kotlinx.android.synthetic.main.fragment_search_dialog.view.*
import kotlinx.android.synthetic.main.search_suggestions_hint.view.* import kotlinx.android.synthetic.main.search_suggestions_hint.view.*
import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.ExperimentalCoroutinesApi
import mozilla.components.browser.toolbar.BrowserToolbar import mozilla.components.browser.toolbar.BrowserToolbar
import mozilla.components.concept.storage.HistoryStorage
import mozilla.components.feature.qr.QrFeature import mozilla.components.feature.qr.QrFeature
import mozilla.components.lib.state.ext.consumeFrom import mozilla.components.lib.state.ext.consumeFrom
import mozilla.components.support.base.feature.UserInteractionHandler import mozilla.components.support.base.feature.UserInteractionHandler
@ -149,7 +150,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
toolbarView = ToolbarView( toolbarView = ToolbarView(
requireContext(), requireContext(),
interactor, interactor,
null, historyStorageProvider(),
isPrivate, isPrivate,
view.toolbar, view.toolbar,
requireComponents.core.engine requireComponents.core.engine
@ -304,6 +305,12 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
} }
} }
private fun historyStorageProvider(): HistoryStorage? {
return if (requireContext().settings().shouldShowHistorySuggestions) {
requireComponents.core.historyStorage
} else null
}
private fun createQrFeature(): QrFeature { private fun createQrFeature(): QrFeature {
return QrFeature( return QrFeature(
requireContext(), requireContext(),