[customizable-menu] Show the custom menu items in custom tabs menu
Categories
(Firefox for Android :: Menu, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox161 | --- | fixed |
People
(Reporter: petru, Assigned: petru)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][android-core])
Attachments
(2 external files)
These are the menu items configured by the application which started the custom tab.
Needed:
- a
CustomTabsMenuBuilderthat has a hardcoded structure of thedefaultcustom tabs menu - this is instantiated by the
MenuStores middleware and queried for the menu configuration to use - the configuration is updated by the
MenuStores middleware to be displayed - the
MenuStores middleware will handle the menu item interactions
Updated•2 months ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
This was done https://phabricator.services.mozilla.com/D331914
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 2•23 days ago
|
||
Testing more things around the new menu I saw that this was actually not implemented.
For how the functionality was supported in the legacy menu:
A-C reads EXTRA_MENU_ITEMS from the custom tab intent in CustomTabConfigHelper.getMenuItems. It keeps each entry that has both a title and a PendingIntent, and doesn't cap the count. The result is CustomTabConfig.menuItems: List<CustomTabMenuItem>, empty by default, where each item has a name and a pendingIntent.
How the legacy menu used them:
- MenuDialogFragment passes customTabMenuItems = customTab?.config?.menuItems to CustomTabMenu.
- If that list isn't empty, CustomTabMenu puts them all in one MenuGroup, one MenuTextItem per item, showing just the name. That group sits after the main items and before "Powered by Firefox".
- A click dispatches MenuAction.CustomMenuItemAction(intent = pendingIntent, url = customTab?.content?.url). The URL is read at click time, because the lambda closes over the tab the fragment observes.
- MenuDialogMiddleware emits NavigationEvent.SendPendingIntentWithUrl, then Dismiss.
- MenuDialogFragment.sendPendingIntentWithUrl calls pendingIntent.send(context, 0, Intent(null, url.toUri())) if the URL isn't null, then dismisses the menu.
| Assignee | ||
Comment 3•23 days ago
|
||
Needed for the custom tab menu items added by apps - which can ask for multiple
menu items to be shown.
See https://developer.chrome.com/docs/android/custom-tabs/guide-interactivity#add_custom_menu_items.
| Assignee | ||
Comment 4•23 days ago
|
||
The legacy custom tab menu shows them so the customizable menu needs to as well before replacing it.
See https://developer.chrome.com/docs/android/custom-tabs/guide-interactivity#add_custom_menu_items.
Comment 6•22 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/34b6575d52de
https://hg.mozilla.org/mozilla-central/rev/88f3c681955e
Description
•