-
Alex Newcomer authored
NOTIFICATION_CONTAINER is a container MenuItemView which is added and removed to an app context menu as notifications for the app come and go. The container is added to the tree of MenuItemViews by adding it to the menu's SimpleMenuModel. The bug is that the container MenuItemView for NOTIFICATION_CONTAINER is not enabled when added. The root cause is that when the NOTIFICATION_CONTAINER is added, it is not addd to |menu_items_|(same name for both classes modified). I originally tried to ensure that items added to the SimpleMenuModel were also added to |menu_items_|, but when adding an item to |menu_items_| in ash/public/cpp/menu_utils.h, we check |delegate_|->IsCommandIdEnabled(), which requires that the item is in |menu_items_|. This means that new items are disabled. This is because |menu_items_| was designed to be built once, and not modified. This fix works because we don't need to check |menu_items_| anyways because NOTIFICATION_CONTAINER is always enabled. Fixing |menu_items_| so that it holds all items that SimpleMenuModel holds would be ideal, but its current behavior is only a problem in the NOTIFICATION_CONTAINER edge case. Bug: 857565 Change-Id: I1ec1d6db20b1ba45d0a772eb2ec7ab3ec0498c06 Reviewed-on: https://chromium-review.googlesource.com/1119057 Commit-Queue: Alex Newcomer <newcomer@chromium.org> Reviewed-by:
James Cook <jamescook@chromium.org> Cr-Commit-Position: refs/heads/master@{#572215}
b34409ec