1
0
Fork 0

For #13028 - Add feature flag for tab history.

master
Kainalu Hagiwara 2020-07-28 09:41:51 -07:00 committed by Jeff Boek
parent b7fabdd2f1
commit 272c380755
3 changed files with 15 additions and 4 deletions

View File

@ -33,4 +33,9 @@ object FeatureFlags {
* Enables swipe on toolbar to switch tabs
*/
val swipeToSwitchTabs = Config.channel.isNightlyOrDebug
/**
* Enables viewing tab history
*/
val tabHistory = Config.channel.isNightlyOrDebug
}

View File

@ -766,8 +766,11 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
}
override fun onBackLongPressed(): Boolean {
findNavController().navigate(R.id.action_global_tabHistoryDialogFragment)
return true
if (FeatureFlags.tabHistory) {
findNavController().navigate(R.id.action_global_tabHistoryDialogFragment)
return true
}
return false
}
/**

View File

@ -23,6 +23,7 @@ import mozilla.components.concept.engine.prompt.ShareData
import mozilla.components.feature.session.SessionFeature
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
import mozilla.components.support.ktx.kotlin.isUrl
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.NavGraphDirections
import org.mozilla.fenix.R
@ -172,10 +173,12 @@ class DefaultBrowserToolbarController(
Do exhaustive when (item) {
ToolbarMenu.Item.Back -> sessionUseCases.goBack.invoke(currentSession)
is ToolbarMenu.Item.Forward -> {
if (item.viewHistory) {
if (FeatureFlags.tabHistory && item.viewHistory) {
navController.navigate(R.id.action_global_tabHistoryDialogFragment)
} else {
} else if (!item.viewHistory) {
sessionUseCases.goForward.invoke(currentSession)
} else {
// Do nothing if tab history feature flag is off and item.viewHistory is true
}
}
is ToolbarMenu.Item.Reload -> {