New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 826510 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Dec 12
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: ----


Participants' hotlists:
Launcher-Tech-Debt


Sign in to add a comment

Combine AppContextMenu and LauncherContextMenu

Project Member Reported by newcomer@chromium.org, Mar 27 2018

Issue description

We can combine AppContextMenu and LauncherContextMenu into one class.

There are also some utilities we could extract from the two classes and share.

AppContextMenu is cached and updated dynamically, while LauncherContextMenu is re-constructed for each use.

After talking to Xiyuan we think it's ok to just re-build the menu because they are small.


 
Owner: newcomer@chromium.org
Cc: msw@chromium.org
Description: Show this description
Relevant comments that came up from review:
It might be nice if this and LauncherContextMenu::GetMenuItemVectorIcon (and LauncherContextMenu::MenuItem and AppContextMenu::CommandId) were consolidated... it's too bad that the two are so similar but slightly different (eg. LAUNCH_NEW vs MENU_OPEN_NEW), but it might still make sense to have one enum and one menu icon utility function shared between the two, that might facilitate some simplification later on. I won't block on this, but I'd encourage some followup or prerequisite cleanup here.

It would also be nice if menus actually used commands with unambiguous meanings, so we didn't need to provide different icons based additional information, like the string id and whether the app was pinned or not. Again, not critical now, but it'd be really nice to see some cleanup here.

Issue 825391 has been merged into this issue.
Cc: warx@chromium.org
 Issue 840057  has been merged into this issue.
More relevant cl comments for future merging of shelf/launcher and applist menu models.

It's too bad that AppListViewContextMenu was already using inheritance to override SimpleMenuModel::Delegate... Is it possible to instead use ash::menu_utils::PopulateMenuFromMojoMenuItems to construct a MenuModel that doesn't require a custom delegate, like ShelfContextMenuModel? That seems more straightforward.  https://cs.chromium.org/chromium/src/ash/public/cpp/menu_utils.h?rcl=a73b4f685c55f2c6aee9decc61264712e7310e65&l=28
Maybe what we really want is to make something like ShelfContextMenuModel for the app list? Perhaps it would be good to generalize a mojom::MenuDelegate that both ShelfItemDelegates and AppList[Item]ViewDelegates can handle context menu item execution for menus constructed of remotely-provided std::vector<ash::mojom::MenuItemPtr>. I'd favor generalization of remotely-supplied/constructed menus in that direction than what we have here.

Comment 8 by msw@chromium.org, May 25 2018

Labels: Pri-3
Status: Assigned (was: Untriaged)
Does this bug need to be restricted?
Labels: -Restrict-View-Google
No, that was from an old bug template that my team used to use. Removed!
Status: WontFix (was: Assigned)
This should be accomplished by the App Service, so no use in keeping this bug around.

Sign in to add a comment