Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: ash/public/interfaces/shelf.mojom

Issue 2750463009: mash: Fix ShelfItem mojo struct; add enums and traits. (Closed)
Patch Set: Sync and rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module ash.mojom; 5 module ash.mojom;
6 6
7 import "mojo/common/string16.mojom"; 7 import "mojo/common/string16.mojom";
8 import "skia/public/interfaces/bitmap.mojom"; 8 import "skia/public/interfaces/bitmap.mojom";
9 import "ui/events/mojo/event.mojom"; 9 import "ui/events/mojo/event.mojom";
10 10
11 // The actions that may be performed when a shelf item is selected. 11 // The actions that may be performed when a shelf item is selected.
12 // These values match ash::ShelfAction. 12 // These values match ash::ShelfAction.
13 enum ShelfAction { 13 enum ShelfAction {
14 NONE, // No action was taken. 14 NONE, // No action was taken.
15 WINDOW_CREATED, // A new window was created. 15 WINDOW_CREATED, // A new window was created.
16 WINDOW_ACTIVATED, // An existing inactive window was activated. 16 WINDOW_ACTIVATED, // An existing inactive window was activated.
17 WINDOW_MINIMIZED, // The currently active window was minimized. 17 WINDOW_MINIMIZED, // The currently active window was minimized.
18 APP_LIST_SHOWN, // The app list launcher menu was shown. 18 APP_LIST_SHOWN, // The app list launcher menu was shown.
19 }; 19 };
20 20
21 // These values match ash::ShelfAlignment. 21 // These values match ash::ShelfAlignment.
22 enum ShelfAlignment { BOTTOM, LEFT, RIGHT, BOTTOM_LOCKED, }; 22 enum ShelfAlignment { BOTTOM, LEFT, RIGHT, BOTTOM_LOCKED, };
23 23
24 // These values match ash::ShelfAutoHideBehavior. 24 // These values match ash::ShelfAutoHideBehavior.
25 enum ShelfAutoHideBehavior { ALWAYS, NEVER, HIDDEN, }; 25 enum ShelfAutoHideBehavior { ALWAYS, NEVER, HIDDEN, };
26 26
27 // Represents the status of items in the shelf.
28 // These values match ash::ShelfItemStatus.
29 enum ShelfItemStatus {
30 CLOSED, // A closed shelf item, i.e. has no live instance.
31 RUNNING, // A shelf item that has live instance.
32 ACTIVE, // An active shelf item that has focus.
33 ATTENTION, // A shelf item that needs user's attention.
34 };
35
36 // The type of a shelf item.
37 // These values match ash::ShelfItemType.
38 enum ShelfItemType {
39 PANEL, // A running app panel.
40 PINNED_APP, // A pinned app, which may be running or not.
41 APP_LIST, // An item that toggles visiblity of the app list.
42 BROWSER, // The browser shortcut, the browser may be running or not.
43 APP, // An unpinned running app window. Supports these app types:
44 // - Extension "V1" (legacy packaged and hosted) apps,
45 // - Extension "V2" (platform) apps,
46 // - ARC (App Runtime for Chrome - Android Play Store) apps.
47 DIALOG, // An open dialog.
48 UNDEFINED, // Default value.
49 };
50
27 // Source of the launch or activation request, for tracking. 51 // Source of the launch or activation request, for tracking.
28 // These values match ash::ShelfLaunchSource. 52 // These values match ash::ShelfLaunchSource.
29 enum ShelfLaunchSource { 53 enum ShelfLaunchSource {
30 UNKNOWN, // The item was launched from outside the app list. 54 UNKNOWN, // The item was launched from outside the app list.
31 APP_LIST, // The item was launched from a generic app list view. 55 APP_LIST, // The item was launched from a generic app list view.
32 APP_LIST_SEARCH, // The item was launched from an app list search view. 56 APP_LIST_SEARCH, // The item was launched from an app list search view.
33 }; 57 };
34 58
35 // The Shelf controller allows clients (eg. Chrome) to control the ash shelf. 59 // The Shelf controller allows clients (eg. Chrome) to control the ash shelf.
36 interface ShelfController { 60 interface ShelfController {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Type type; // The type of the menu item. 108 Type type; // The type of the menu item.
85 uint32 command_id; // The client's arbitrary item command id. 109 uint32 command_id; // The client's arbitrary item command id.
86 mojo.common.mojom.String16 label; // The string label, may be empty. 110 mojo.common.mojom.String16 label; // The string label, may be empty.
87 skia.mojom.Bitmap image; // The image icon, may be null. 111 skia.mojom.Bitmap image; // The image icon, may be null.
88 array<MenuItem>? submenu; // The optional nested submenu item list. 112 array<MenuItem>? submenu; // The optional nested submenu item list.
89 bool enabled; // The enabled state. 113 bool enabled; // The enabled state.
90 bool checked; // The checked state. 114 bool checked; // The checked state.
91 uint32 radio_group_id; // The radio group id. 115 uint32 radio_group_id; // The radio group id.
92 }; 116 };
93 117
94 // ShelfItem contains the basic fields needed to pin shortcut items. 118 // ShelfItems are used to populate the shelf.
119 // This structure matches ash::ShelfItem.
95 struct ShelfItem { 120 struct ShelfItem {
96 // An app id, used to correlate windows and shortcuts (eg. 'mojo:foo'). 121 ShelfItemType type; // The type of the shelf item.
97 string app_id; 122 skia.mojom.Bitmap image; // An icon image Bitmap, shown on the shelf.
98 123 int64 shelf_id; // A shelf model ID used by the shelf and clients.
99 // A app title, used for tooltips, etc. (eg. 'Foo Application'). 124 ShelfItemStatus status; // The running/closed/etc. status of the item.
100 string app_title; 125 string app_id; // An app id string, used to match app windows.
101 126 mojo.common.mojom.String16 title; // The title to display for tooltips, etc.
102 // An icon image Bitmap, shown on the shelf. 127 bool shows_tooltip; // Whether the tooltip should be shown on hover.
103 skia.mojom.Bitmap image; 128 bool pinned_by_policy; // Whether the item is pinned by policy preferences,
104 129 // the user cannot un-pin these items.
James Cook 2017/03/16 16:48:50 Thanks for documenting all the stuff in this file.
msw 2017/03/16 23:15:50 Acknowledged.
105 // Additional context menu items (eg. 'New Incognito Window').
106 array<MenuItem>? context_menu_items;
107 }; 130 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698