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

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

Issue 1839223003: Add basic Chrome interaction with the mash shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use associated interfaces for observers and item delegates. Created 4 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 module mash.shelf.mojom;
6
7 import "skia/public/interfaces/bitmap.mojom";
8
9 // The Shelf controller allows clients (eg. Chrome) to control the mash shelf.
10 interface ShelfController {
11 AddObserver(associated ShelfObserver observer);
12
13 SetAlignment(Alignment alignment);
14 SetAutoHideBehavior(AutoHideBehavior auto_hide);
15
16 AddItem(ShelfItem item, associated ShelfItemDelegate delegate);
17 RemoveItem(string id);
18 };
19
20 // ShelfObserver is notified on shelf changes; used to persist profile settings.
21 interface ShelfObserver {
22 OnAlignmentChanged(Alignment alignment);
23 OnAutoHideBehaviorChanged(AutoHideBehavior auto_hide);
24 };
25
26 // ShelfItemDelegate handles command execution and observes shelf item changes.
27 interface ShelfItemDelegate {
28 // Called on invocation of a shelf item's context menu command.
29 ExecuteCommand(uint32 command_id, int32 event_flags);
30
31 // Called when a shelf item is pinned or unpinned.
32 ItemPinned();
33 ItemUnpinned();
34
35 // Called when a pinned shelf item is reordered.
36 // |order| is the index of the item on the shelf.
37 ItemReordered(uint32 order);
38 };
39
40 // These values match ash::ShelfAlignment.
41 enum Alignment { BOTTOM, LEFT, RIGHT, };
42
43 // These values match ash::ShelfAutoHideBehavior.
44 enum AutoHideBehavior { ALWAYS, NEVER, HIDDEN, };
45
46 // ContextMenuItems may be used to supplement ash shelf item context menus.
47 struct ContextMenuItem {
48 enum Type { ITEM, CHECK, RADIO, SEPARATOR, SUBMENU };
49
50 Type type;
51 uint32 command_id;
52 string? label;
53 array<ContextMenuItem>? submenu;
54 bool enabled;
55 bool checked;
56 uint32 radio_group_id;
57 };
58
59 // ShelfItem contains the basic fields needed to pin shortcut items.
60 struct ShelfItem {
61 // An id, used to correlate windows and shortcuts (eg. 'exe:chrome').
62 string id;
63
64 // A title, used for tooltips, etc. (eg. 'Chrome').
65 string title;
66
67 // An icon image Bitmap, shown on the shelf.
68 skia.mojom.Bitmap image;
69
70 // Additional context menu items (eg. 'New Incognito Window').
71 array<ContextMenuItem>? context_menu_items;
72 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698