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

[fenix] Closes https://github.com/mozilla-mobile/fenix/issues/1914 - Removes incomplete actions from Custom Tab Menu

This commit is contained in:
Emily Kager 2019-04-23 12:50:17 -07:00 committed by Colin Lee
parent 7083f346bf
commit 07fbeaeeba
3 changed files with 2 additions and 20 deletions

View File

@ -89,7 +89,6 @@ class ToolbarUIView(
val menuToolbar = if (isCustom) {
CustomTabToolbarMenu(this,
requestDesktopStateProvider = { session?.desktopMode ?: false },
onItemTapped = { actionEmitter.onNext(SearchAction.ToolbarMenuItemTapped(it)) }
)
} else {

View File

@ -9,7 +9,6 @@ import mozilla.components.browser.menu.BrowserMenuBuilder
import mozilla.components.browser.menu.item.BrowserMenuDivider
import mozilla.components.browser.menu.item.BrowserMenuImageText
import mozilla.components.browser.menu.item.BrowserMenuItemToolbar
import mozilla.components.browser.menu.item.BrowserMenuSwitch
import mozilla.components.browser.menu.item.SimpleBrowserMenuItem
import org.mozilla.fenix.DefaultThemeManager
import org.mozilla.fenix.R
@ -18,7 +17,6 @@ import org.mozilla.fenix.ext.components
class CustomTabToolbarMenu(
private val context: Context,
private val requestDesktopStateProvider: () -> Boolean = { false },
private val onItemTapped: (ToolbarMenu.Item) -> Unit = {}
) : ToolbarMenu {
override val menuBuilder by lazy { BrowserMenuBuilder(menuItems) }
@ -117,19 +115,6 @@ class CustomTabToolbarMenu(
onItemTapped.invoke(ToolbarMenu.Item.OpenInFenix)
},
BrowserMenuImageText(
context.getString(R.string.browser_menu_find_in_page),
R.drawable.mozac_ic_search,
DefaultThemeManager.resolveAttribute(R.attr.primaryText, context)
) {
onItemTapped.invoke(ToolbarMenu.Item.FindInPage)
},
BrowserMenuSwitch(context.getString(R.string.browser_menu_desktop_site),
requestDesktopStateProvider, { checked ->
onItemTapped.invoke(ToolbarMenu.Item.RequestDesktop(checked))
}),
BrowserMenuImageText(
context.getString(R.string.browser_menu_share),
R.drawable.mozac_ic_share,

View File

@ -22,11 +22,9 @@ class CustomTabsIntegration(
onItemTapped: (ToolbarMenu.Item) -> Unit = {}
) : LifecycleAwareFeature, BackHandler {
private val session = sessionManager.findSessionById(sessionId)
private val customTabToolbarMenu by lazy {
CustomTabToolbarMenu(context,
requestDesktopStateProvider = { session?.desktopMode ?: false },
CustomTabToolbarMenu(
context,
onItemTapped = onItemTapped
)
}