[go: nahoru, domu]

mash: Add shelf context menu support.

Chrome serializes its shelf item context menus for Ash.
Ash displays the menus and reports invocations to Chrome.

Add an ash-side ShelfContextMenu class that supports:
-Local menu items to set shelf & wallpaper prefs/settings.
-Proxies Chrome's menu items via mojo structs/interfaces.
-Also used for wallpaper/desktop context menus (via RWC).

Add ash::mojom::ShelfItemDelegate::GetContextMenuItems, etc.:
-Extend ExecuteCommand, MenuItem, etc. to support context menus.
-Denote the command's origin (context/app menu) and display id.
-Allow 64-bit int command and radio-group ids; null images.
-Add ash::mojom::MenuItemType=ui::MenuModel::ItemType traits.

Add common ash::ShelfItemDelegate context menu handling:
-Subclasses override new virtual GetContextMenu() helper.
-GetContextMenuItems() stores the MenuModel for execution.
-ExecuteContextMenuCommand() handles context menu invocation.

Wire up chrome's launcher item subclass context menus.
Make minor launcher context menu class simplifications.
Add a ShelfWindowWatcher context menu item for closing.

Remove mus, ash_shell, test, and desktop context menu classes.
Remove ShellDelegate::CreateContextMenu and ash::ShelfAlignmentMenu.
Inline CanChangeShelfAlignment; move CanUserModifyShelfAutoHideBehavior.
Add unit tests, flip TestWallpaperDelegate::CanOpenSetWallpaperPage.

Bug: 640693, 753028
Test: No Chrome OS shelf/desktop context menu behavior changes.
Change-Id: I3afb93095b4042dca57d16844c5b05308f06a384
TBR: caitkp@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/571517
Commit-Queue: Michael Wasserman <msw@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495735}
72 files changed