| Index: ash/public/interfaces/shelf.mojom
|
| diff --git a/ash/public/interfaces/shelf.mojom b/ash/public/interfaces/shelf.mojom
|
| index 020a5577d5bf1cfe4b37ce6f58b9293df4d87b65..0d6d20b657236f73038d0caff5434f877336ba22 100644
|
| --- a/ash/public/interfaces/shelf.mojom
|
| +++ b/ash/public/interfaces/shelf.mojom
|
| @@ -4,7 +4,19 @@
|
|
|
| module ash.mojom;
|
|
|
| +import "mojo/common/string16.mojom";
|
| import "skia/public/interfaces/bitmap.mojom";
|
| +import "ui/events/mojo/event.mojom";
|
| +
|
| +// The actions that may be performed when a shelf item is selected.
|
| +// These values match ash::ShelfAction.
|
| +enum ShelfAction {
|
| + NONE, // No action was taken.
|
| + WINDOW_CREATED, // A new window was created.
|
| + WINDOW_ACTIVATED, // An existing inactive window was activated.
|
| + WINDOW_MINIMIZED, // The currently active window was minimized.
|
| + APP_LIST_SHOWN, // The app list launcher menu was shown.
|
| +};
|
|
|
| // These values match ash::ShelfAlignment.
|
| enum ShelfAlignment { BOTTOM, LEFT, RIGHT, BOTTOM_LOCKED, };
|
| @@ -12,6 +24,14 @@ enum ShelfAlignment { BOTTOM, LEFT, RIGHT, BOTTOM_LOCKED, };
|
| // These values match ash::ShelfAutoHideBehavior.
|
| enum ShelfAutoHideBehavior { ALWAYS, NEVER, HIDDEN, };
|
|
|
| +// Source of the launch or activation request, for tracking.
|
| +// These values match ash::ShelfLaunchSource.
|
| +enum ShelfLaunchSource {
|
| + UNKNOWN, // The item was launched from outside the app list.
|
| + APP_LIST, // The item was launched from a generic app list view.
|
| + APP_LIST_SEARCH, // The item was launched from an app list search view.
|
| +};
|
| +
|
| // The Shelf controller allows clients (eg. Chrome) to control the ash shelf.
|
| interface ShelfController {
|
| // Observers are immediately notified of the current shelf states when added.
|
| @@ -34,34 +54,41 @@ interface ShelfObserver {
|
| OnAutoHideBehaviorChanged(ShelfAutoHideBehavior auto_hide, int64 display_id);
|
| };
|
|
|
| -// ShelfItemDelegate handles command execution and observes shelf item changes.
|
| +// ShelfItemDelegate handles shelf item selection, menu command execution, etc.
|
| interface ShelfItemDelegate {
|
| - // Called when a pinned shelf item is invoked without an open window.
|
| - LaunchItem();
|
| -
|
| - // Called on invocation of a shelf item's context menu command.
|
| + // Called when the user selects a shelf item. The event, display, and source
|
| + // info should be provided if known; some implementations use these arguments.
|
| + // Defaults: (nullptr, kInvalidDisplayId, LAUNCH_FROM_UNKNOWN)
|
| + // The callback reports the action taken and any app menu items to show.
|
| + //
|
| + // NOTE: This codepath is not currently used for context menu triggering.
|
| + // TODO(msw): Remove |display_id| once panels are removed. crbug.com/691099
|
| + ItemSelected(ui.mojom.Event event,
|
| + int64 display_id,
|
| + ShelfLaunchSource source) => (ShelfAction action,
|
| + array<MenuItem>? menu_items);
|
| +
|
| + // Called on invocation of a shelf item's context or application menu command.
|
| ExecuteCommand(uint32 command_id, int32 event_flags);
|
|
|
| - // Called when a shelf item is pinned or unpinned.
|
| - ItemPinned();
|
| - ItemUnpinned();
|
| -
|
| - // Called when a pinned shelf item is reordered.
|
| - // |order| is the index of the item on the shelf.
|
| - ItemReordered(uint32 order);
|
| + // Closes all windows associated with this shelf item.
|
| + Close();
|
| };
|
|
|
| -// ContextMenuItems may be used to supplement ash shelf item context menus.
|
| -struct ContextMenuItem {
|
| +// MenuItems are used to populate application menus for shelf items.
|
| +// Note: Some menus only support a subset of these item features (eg. no icons).
|
| +// Note: These are not yet used for shelf item or ash shell context menus.
|
| +struct MenuItem {
|
| enum Type { ITEM, CHECK, RADIO, SEPARATOR, SUBMENU };
|
|
|
| - Type type;
|
| - uint32 command_id;
|
| - string? label;
|
| - array<ContextMenuItem>? submenu;
|
| - bool enabled;
|
| - bool checked;
|
| - uint32 radio_group_id;
|
| + Type type; // The type of the menu item.
|
| + uint32 command_id; // The client's arbitrary item command id.
|
| + mojo.common.mojom.String16 label; // The string label, may be empty.
|
| + skia.mojom.Bitmap image; // The image icon, may be null.
|
| + array<MenuItem>? submenu; // The optional nested submenu item list.
|
| + bool enabled; // The enabled state.
|
| + bool checked; // The checked state.
|
| + uint32 radio_group_id; // The radio group id.
|
| };
|
|
|
| // ShelfItem contains the basic fields needed to pin shortcut items.
|
| @@ -76,5 +103,5 @@ struct ShelfItem {
|
| skia.mojom.Bitmap image;
|
|
|
| // Additional context menu items (eg. 'New Incognito Window').
|
| - array<ContextMenuItem>? context_menu_items;
|
| + array<MenuItem>? context_menu_items;
|
| };
|
|
|