Commit 314ec025 authored by Matthew Finkel's avatar Matthew Finkel
Browse files

Bug 40005: Modify Default toolbar menu

parent 3d692de2
......@@ -9,6 +9,8 @@ import android.widget.PopupWindow
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.collect
import mozilla.components.concept.engine.webextension.WebExtensionBrowserAction
import mozilla.components.concept.engine.webextension.WebExtensionPageAction
import mozilla.components.browser.menu.facts.emitOpenMenuItemFact
import mozilla.components.browser.menu.item.WebExtensionBrowserMenuItem
import mozilla.components.browser.state.selector.selectedTab
......
......@@ -66,20 +66,10 @@ class WebExtensionBrowserMenuBuilder(
iconTintColorResource = webExtIconTintColorResource
)
val addonsManagerMenuItem = BrowserMenuImageText(
label = context.getString(R.string.mozac_browser_menu_addons_manager),
imageResource = R.drawable.mozac_ic_extensions,
iconTintColorResource = webExtIconTintColorResource
) {
onAddonsManagerTapped.invoke()
}
val webExtSubMenuItems = if (appendExtensionSubMenuAtStart) {
listOf(backPressMenuItem) + BrowserMenuDivider() +
filteredExtensionMenuItems +
BrowserMenuDivider() + addonsManagerMenuItem
filteredExtensionMenuItems
} else {
listOf(addonsManagerMenuItem) + BrowserMenuDivider() +
filteredExtensionMenuItems +
BrowserMenuDivider() + backPressMenuItem
}
......@@ -95,17 +85,13 @@ class WebExtensionBrowserMenuBuilder(
endOfMenuAlwaysVisible = endOfMenuAlwaysVisible
)
} else {
BrowserMenuImageText(
label = context.getString(R.string.mozac_browser_menu_addons),
imageResource = R.drawable.mozac_ic_extensions,
iconTintColorResource = webExtIconTintColorResource
) {
onAddonsManagerTapped.invoke()
}
null
}
val menuItems =
if (appendExtensionSubMenuAtStart) {
if (webExtMenuItem == null) {
items
} else if (appendExtensionSubMenuAtStart) {
listOf(webExtMenuItem) + finalList
} else {
finalList + webExtMenuItem
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment