For #13028 - Add feature flag for tab history.
parent
b7fabdd2f1
commit
272c380755
|
@ -33,4 +33,9 @@ object FeatureFlags {
|
||||||
* Enables swipe on toolbar to switch tabs
|
* Enables swipe on toolbar to switch tabs
|
||||||
*/
|
*/
|
||||||
val swipeToSwitchTabs = Config.channel.isNightlyOrDebug
|
val swipeToSwitchTabs = Config.channel.isNightlyOrDebug
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables viewing tab history
|
||||||
|
*/
|
||||||
|
val tabHistory = Config.channel.isNightlyOrDebug
|
||||||
}
|
}
|
||||||
|
|
|
@ -766,8 +766,11 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackLongPressed(): Boolean {
|
override fun onBackLongPressed(): Boolean {
|
||||||
findNavController().navigate(R.id.action_global_tabHistoryDialogFragment)
|
if (FeatureFlags.tabHistory) {
|
||||||
return true
|
findNavController().navigate(R.id.action_global_tabHistoryDialogFragment)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,6 +23,7 @@ import mozilla.components.concept.engine.prompt.ShareData
|
||||||
import mozilla.components.feature.session.SessionFeature
|
import mozilla.components.feature.session.SessionFeature
|
||||||
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
|
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
|
||||||
import mozilla.components.support.ktx.kotlin.isUrl
|
import mozilla.components.support.ktx.kotlin.isUrl
|
||||||
|
import org.mozilla.fenix.FeatureFlags
|
||||||
import org.mozilla.fenix.HomeActivity
|
import org.mozilla.fenix.HomeActivity
|
||||||
import org.mozilla.fenix.NavGraphDirections
|
import org.mozilla.fenix.NavGraphDirections
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
|
@ -172,10 +173,12 @@ class DefaultBrowserToolbarController(
|
||||||
Do exhaustive when (item) {
|
Do exhaustive when (item) {
|
||||||
ToolbarMenu.Item.Back -> sessionUseCases.goBack.invoke(currentSession)
|
ToolbarMenu.Item.Back -> sessionUseCases.goBack.invoke(currentSession)
|
||||||
is ToolbarMenu.Item.Forward -> {
|
is ToolbarMenu.Item.Forward -> {
|
||||||
if (item.viewHistory) {
|
if (FeatureFlags.tabHistory && item.viewHistory) {
|
||||||
navController.navigate(R.id.action_global_tabHistoryDialogFragment)
|
navController.navigate(R.id.action_global_tabHistoryDialogFragment)
|
||||||
} else {
|
} else if (!item.viewHistory) {
|
||||||
sessionUseCases.goForward.invoke(currentSession)
|
sessionUseCases.goForward.invoke(currentSession)
|
||||||
|
} else {
|
||||||
|
// Do nothing if tab history feature flag is off and item.viewHistory is true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is ToolbarMenu.Item.Reload -> {
|
is ToolbarMenu.Item.Reload -> {
|
||||||
|
|
Loading…
Reference in New Issue