diff --git a/app/src/main/java/org/mozilla/fenix/components/toolbar/ToolbarUIView.kt b/app/src/main/java/org/mozilla/fenix/components/toolbar/ToolbarUIView.kt index 8783497f60..993b945de9 100644 --- a/app/src/main/java/org/mozilla/fenix/components/toolbar/ToolbarUIView.kt +++ b/app/src/main/java/org/mozilla/fenix/components/toolbar/ToolbarUIView.kt @@ -89,7 +89,6 @@ class ToolbarUIView( val menuToolbar = if (isCustom) { CustomTabToolbarMenu(this, - requestDesktopStateProvider = { session?.desktopMode ?: false }, onItemTapped = { actionEmitter.onNext(SearchAction.ToolbarMenuItemTapped(it)) } ) } else { diff --git a/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabToolbarMenu.kt b/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabToolbarMenu.kt index 683922d846..e9da576100 100644 --- a/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabToolbarMenu.kt +++ b/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabToolbarMenu.kt @@ -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, diff --git a/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabsIntegration.kt b/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabsIntegration.kt index ed74343fe3..db85396e24 100644 --- a/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabsIntegration.kt +++ b/app/src/main/java/org/mozilla/fenix/customtabs/CustomTabsIntegration.kt @@ -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 ) }