mash: Support context menus; including additional items from shelf buttons. mojo:ash_sysui had some initial support here; we'll need to port that to mojo:ash. We'll also need to populate additional items from shelf buttons (new window, etc.)
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0e91d93494aa2e7638df38c11b0c7d881d46c213 commit 0e91d93494aa2e7638df38c11b0c7d881d46c213 Author: msw <msw@chromium.org> Date: Thu Aug 25 22:34:09 2016 mash: Port mojo:ash_sysui's ContextMenuMus to mojo:ash. Move and rename ash/common/wallpaper/wallpaper_delegate.h Move instance/accessor to WmShell; rename subclasses, etc. Add NativeWidgetFactoryMus for mojo:ash's ui widgets. (needed to make a NativeWidgetMus for the context menu) BUG= 640693 , 629605 TEST=Basic context menus show in mash; no cros changes. R=jamescook@chromium.org,sky@chromium.org TBR=stevenjb@chromium.org,yusukes@chromium.org Review-Url: https://codereview.chromium.org/2271373002 Cr-Commit-Position: refs/heads/master@{#414561} [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/accelerators/accelerator_controller_delegate_aura.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/ash.gyp [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/common/shell_delegate.h [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/common/wallpaper/wallpaper_delegate.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/common/wm_shell.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/common/wm_shell.h [delete] https://crrev.com/403a3527c8254da0addb2b650020dc11d241b0c3/ash/default_user_wallpaper_delegate.cc [add] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/default_wallpaper_delegate.cc [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/default_wallpaper_delegate.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/desktop_background/desktop_background_controller.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/desktop_background/desktop_background_controller_unittest.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/desktop_background/desktop_background_view.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/desktop_background/desktop_background_widget_controller.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/BUILD.gn [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/bridge/wm_shell_mus.cc [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/context_menu_mus.cc [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/context_menu_mus.h [add] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/native_widget_factory_mus.cc [add] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/native_widget_factory_mus.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/shell_delegate_mus.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/shell_delegate_mus.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/window_manager_application.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/mus/window_manager_application.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/root_window_controller.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/shell.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/shell.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/shell/shell_delegate_impl.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/shell/shell_delegate_impl.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/sysui/BUILD.gn [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/sysui/shell_delegate_mus.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/sysui/shell_delegate_mus.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/sysui/sysui_application.cc [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/sysui/wallpaper_delegate_mus.cc [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/sysui/wallpaper_delegate_mus.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/test/test_shell_delegate.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/test/test_shell_delegate.h [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/test/test_wallpaper_delegate.cc [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/ash/test/test_wallpaper_delegate.h [delete] https://crrev.com/403a3527c8254da0addb2b650020dc11d241b0c3/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h [rename] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/chromeos/background/ash_wallpaper_delegate.cc [add] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/chromeos/background/ash_wallpaper_delegate.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/chromeos/login/ui/login_display_host_impl.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/ui/ash/chrome_shell_delegate.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/ui/ash/chrome_shell_delegate.h [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/ui/ash/launcher/launcher_context_menu.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/ui/webui/options/browser_options_handler.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/browser/ui/webui/settings/appearance_handler.cc [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/chrome/chrome_browser_chromeos.gypi [modify] https://crrev.com/0e91d93494aa2e7638df38c11b0c7d881d46c213/components/arc/intent_helper/arc_intent_helper_bridge.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/20734f8bc75635b1cf93c7cd9a4333e207041623 commit 20734f8bc75635b1cf93c7cd9a4333e207041623 Author: msw <msw@chromium.org> Date: Tue Sep 13 16:08:55 2016 mash: Port context menu code to WmShell and WmRootWindowController. BUG= 640693 TEST=Context menus show up for the wallpaper and shelf. R=sky@chromium.org Review-Url: https://codereview.chromium.org/2336883002 Cr-Commit-Position: refs/heads/master@{#418263} [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/aura/wm_shell_aura.cc [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/aura/wm_shell_aura.h [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/common/wm_root_window_controller.cc [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/common/wm_root_window_controller.h [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/common/wm_shell.cc [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/common/wm_shell.h [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/mus/bridge/wm_shell_mus.cc [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/mus/bridge/wm_shell_mus.h [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/root_window_controller.cc [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/root_window_controller.h [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/shell.cc [modify] https://crrev.com/20734f8bc75635b1cf93c7cd9a4333e207041623/ash/shell.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/47bf178b9802260a023f43f3170ca7b4e6242163 commit 47bf178b9802260a023f43f3170ca7b4e6242163 Author: Michael Wasserman <msw@chromium.org> Date: Fri Aug 18 23:17:10 2017 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} [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/BUILD.gn [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/DEPS [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/mus/BUILD.gn [delete] https://crrev.com/4abd415249b454c1520f6ab9465564edcb3bb974/ash/mus/context_menu_mus.cc [delete] https://crrev.com/4abd415249b454c1520f6ab9465564edcb3bb974/ash/mus/context_menu_mus.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/mus/shell_delegate_mus.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/mus/shell_delegate_mus.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/cpp/remote_shelf_item_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/cpp/remote_shelf_item_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/cpp/shelf_item_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/cpp/shelf_item_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/cpp/shelf_prefs.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/cpp/shelf_prefs.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/cpp/shelf_struct_traits.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/interfaces/shelf.mojom [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/public/interfaces/shelf.typemap [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/root_window_controller.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/app_list_shelf_item_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/app_list_shelf_item_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf.h [delete] https://crrev.com/4abd415249b454c1520f6ab9465564edcb3bb974/ash/shelf/shelf_alignment_menu.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_application_menu_model.cc [add] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_context_menu_model.cc [add] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_context_menu_model.h [add] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_context_menu_model_unittest.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_view.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_view.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_view_test_api.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_view_test_api.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_view_unittest.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_window_watcher_item_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shelf/shelf_window_watcher_item_delegate.h [delete] https://crrev.com/4abd415249b454c1520f6ab9465564edcb3bb974/ash/shell/context_menu.cc [delete] https://crrev.com/4abd415249b454c1520f6ab9465564edcb3bb974/ash/shell/context_menu.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shell/shell_delegate_impl.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shell/shell_delegate_impl.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shell/window_watcher_shelf_item_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shell/window_watcher_shelf_item_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shell_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/shell_port.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/strings/BUILD.gn [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/test_shell_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/test_shell_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/wallpaper/test_wallpaper_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/ash/wallpaper/test_wallpaper_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/chrome_shell_delegate.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/chrome_shell_delegate.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controller.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controller.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc [delete] https://crrev.com/4abd415249b454c1520f6ab9465564edcb3bb974/chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc [delete] https://crrev.com/4abd415249b454c1520f6ab9465564edcb3bb974/chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/extension_launcher_context_menu.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/extension_launcher_context_menu.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/launcher_context_menu.cc [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/launcher_context_menu.h [modify] https://crrev.com/47bf178b9802260a023f43f3170ca7b4e6242163/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
Comment 1 by bugdroid1@chromium.org
, Aug 25 2016