Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 mash.shelf.mojom; | 5 module ash.mojom; |
| 6 | 6 |
| 7 import "mash/shelf/public/interfaces/shelf_constants.mojom"; | |
| 8 import "skia/public/interfaces/bitmap.mojom"; | 7 import "skia/public/interfaces/bitmap.mojom"; |
| 9 | 8 |
| 10 // TODO(msw): Add support for multiple displays (with unified and multi-shelf). | 9 // These values match ash::ShelfAlignment. |
| 10 enum ShelfAlignment { BOTTOM, LEFT, RIGHT, BOTTOM_LOCKED, }; | |
| 11 | 11 |
| 12 // The Shelf controller allows clients (eg. Chrome) to control the mash shelf. | 12 // These values match ash::ShelfAutoHideBehavior. |
| 13 enum ShelfAutoHideBehavior { ALWAYS, NEVER, HIDDEN, }; | |
| 14 | |
| 15 // The Shelf controller allows clients (eg. Chrome) to control the ash shelf. | |
| 13 interface ShelfController { | 16 interface ShelfController { |
| 14 AddObserver(associated ShelfObserver observer); | 17 AddObserver(associated ShelfObserver observer); |
|
James Cook
2016/08/19 22:43:31
Does the observer get notified with the current st
msw
2016/08/19 23:05:54
Done.
| |
| 15 | 18 |
| 16 SetAlignment(Alignment alignment); | 19 SetAlignment(ShelfAlignment alignment, int64 display_id); |
|
James Cook
2016/08/19 22:43:31
Q: Where does Chrome set the alignment/auto-hide b
msw
2016/08/19 23:05:54
Yeah, ChromeMashShelfController sets the alignment
| |
| 17 SetAutoHideBehavior(AutoHideBehavior auto_hide); | 20 SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide, int64 display_id); |
| 18 | 21 |
| 19 PinItem(ShelfItem item, associated ShelfItemDelegate delegate); | 22 PinItem(ShelfItem item, associated ShelfItemDelegate delegate); |
| 20 UnpinItem(string app_id); | 23 UnpinItem(string app_id); |
| 21 | 24 |
| 22 SetItemImage(string app_id, skia.mojom.Bitmap image); | 25 SetItemImage(string app_id, skia.mojom.Bitmap image); |
| 23 }; | 26 }; |
| 24 | 27 |
| 25 // ShelfObserver is notified on shelf changes; used to persist profile settings. | 28 // ShelfObserver is notified on shelf changes; used to persist profile settings. |
| 26 interface ShelfObserver { | 29 interface ShelfObserver { |
| 27 OnAlignmentChanged(Alignment alignment); | 30 OnShelfCreated(int64 display_id); |
| 28 OnAutoHideBehaviorChanged(AutoHideBehavior auto_hide); | 31 OnAlignmentChanged(ShelfAlignment alignment, int64 display_id); |
| 32 OnAutoHideBehaviorChanged(ShelfAutoHideBehavior auto_hide, int64 display_id); | |
| 29 }; | 33 }; |
| 30 | 34 |
| 31 // ShelfItemDelegate handles command execution and observes shelf item changes. | 35 // ShelfItemDelegate handles command execution and observes shelf item changes. |
| 32 interface ShelfItemDelegate { | 36 interface ShelfItemDelegate { |
| 33 // Called when a pinned shelf item is invoked without an open window. | 37 // Called when a pinned shelf item is invoked without an open window. |
| 34 LaunchItem(); | 38 LaunchItem(); |
| 35 | 39 |
| 36 // Called on invocation of a shelf item's context menu command. | 40 // Called on invocation of a shelf item's context menu command. |
| 37 ExecuteCommand(uint32 command_id, int32 event_flags); | 41 ExecuteCommand(uint32 command_id, int32 event_flags); |
| 38 | 42 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 65 | 69 |
| 66 // A app title, used for tooltips, etc. (eg. 'Foo Application'). | 70 // A app title, used for tooltips, etc. (eg. 'Foo Application'). |
| 67 string app_title; | 71 string app_title; |
| 68 | 72 |
| 69 // An icon image Bitmap, shown on the shelf. | 73 // An icon image Bitmap, shown on the shelf. |
| 70 skia.mojom.Bitmap image; | 74 skia.mojom.Bitmap image; |
| 71 | 75 |
| 72 // Additional context menu items (eg. 'New Incognito Window'). | 76 // Additional context menu items (eg. 'New Incognito Window'). |
| 73 array<ContextMenuItem>? context_menu_items; | 77 array<ContextMenuItem>? context_menu_items; |
| 74 }; | 78 }; |
| OLD | NEW |