For #14212: Pass historyStorage to ToolbarView

pull/101/head
Michael Debertol 4 years ago committed by Jeff Boek
parent cc8aa1f381
commit 4142c36820

@ -37,6 +37,7 @@ import kotlinx.android.synthetic.main.fragment_search_dialog.view.*
import kotlinx.android.synthetic.main.search_suggestions_hint.view.*
import kotlinx.coroutines.ExperimentalCoroutinesApi
import mozilla.components.browser.toolbar.BrowserToolbar
import mozilla.components.concept.storage.HistoryStorage
import mozilla.components.feature.qr.QrFeature
import mozilla.components.lib.state.ext.consumeFrom
import mozilla.components.support.base.feature.UserInteractionHandler
@ -149,7 +150,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
toolbarView = ToolbarView(
requireContext(),
interactor,
null,
historyStorageProvider(),
isPrivate,
view.toolbar,
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 {
return QrFeature(
requireContext(),

Loading…
Cancel
Save