Chromium Code Reviews| Index: ash/public/interfaces/shelf.mojom |
| diff --git a/ash/public/interfaces/shelf.mojom b/ash/public/interfaces/shelf.mojom |
| index faaeddf3bd8ad28e5bbcba7b651b02694db0fd8c..171a4faee2069f150bd67edec79632dd5b6196ae 100644 |
| --- a/ash/public/interfaces/shelf.mojom |
| +++ b/ash/public/interfaces/shelf.mojom |
| @@ -61,14 +61,19 @@ interface ShelfController { |
| // Observers are immediately notified of the current shelf states when added. |
| AddObserver(associated ShelfObserver observer); |
| + // Start syncing a remote (Chrome) ShelfModel and the local (Ash) ShelfModel. |
| + // Chrome's supplied |observer| will be notified of Ash's ShelfModel changes. |
| + // The callback passes Ash's corresponding |observer| of Chrome's ShelfModel. |
| + // Chrome delays binding its observer until the callback is run, so it can |
| + // prepend Ash's |items| and notify Ash's observer of existing Chrome items. |
| + LinkShelfModels(ShelfModelObserver observer) => (ShelfModelObserver observer, |
|
sky
2017/05/26 19:42:01
Is there a reason you don't want LinkShelfModels t
msw
2017/05/27 00:04:38
I've started pursuing changes like what you sugges
|
| + array<ShelfItem> items); |
| + |
| // Set the shelf alignment and auto-hide behavior. See Shelf for details. |
| + // TODO(jamescook): Eliminate all these methods and use the ash pref service |
| + // to observe and to set prefs. http://crbug.com/723085 |
| SetAlignment(ShelfAlignment alignment, int64 display_id); |
| SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide, int64 display_id); |
| - |
| - // Pin and unpin items on the shelf, or update shelf item images. |
| - PinItem(ShelfItem item, associated ShelfItemDelegate delegate); |
| - UnpinItem(string app_id); |
| - SetItemImage(string app_id, skia.mojom.Bitmap image); |
| }; |
| // ShelfObserver is notified on shelf changes; used to persist profile settings. |
| @@ -80,6 +85,15 @@ interface ShelfObserver { |
| OnAutoHideBehaviorChanged(ShelfAutoHideBehavior auto_hide, int64 display_id); |
| }; |
| +// ShelfModelObserver is notified on changes to the shelf model and its items. |
| +interface ShelfModelObserver { |
| + OnShelfItemAdded(int32 index, ShelfItem item); |
| + OnShelfItemRemoved(int32 index, ShelfItem item); |
| + OnShelfItemMoved(int32 start_index, int32 target_index); |
| + OnShelfItemChanged(int32 index, ShelfItem item); |
| + OnShelfItemDelegateChanged(ShelfID id, ShelfItemDelegate delegate); |
| +}; |
| + |
| // ShelfItemDelegate handles shelf item selection, menu command execution, etc. |
| interface ShelfItemDelegate { |
| // Called when the user selects a shelf item. The event, display, and source |
| @@ -129,12 +143,12 @@ struct ShelfID { |
| // ShelfItems are used to populate the shelf. |
| // This structure matches ash::ShelfItem. |
| struct ShelfItem { |
| - ShelfItemType type; // The type of the shelf item. |
| - skia.mojom.Bitmap image; // An icon image Bitmap, shown on the shelf. |
| - ShelfItemStatus status; // The running/closed/etc. status of the item. |
| - ShelfID shelf_id; // The id for the shelf item and its windows. |
| + ShelfItemType type; // The type of the shelf item. |
| + skia.mojom.Bitmap? image; // An icon image Bitmap, shown on the shelf. |
| + ShelfItemStatus status; // The running/closed/etc. status of the item. |
| + ShelfID shelf_id; // The id for the shelf item and its windows. |
| mojo.common.mojom.String16 title; // The title to display for tooltips, etc. |
| - bool shows_tooltip; // Whether the tooltip should be shown on hover. |
| - bool pinned_by_policy; // Whether the item is pinned by policy preferences, |
| - // the user cannot un-pin these items. |
| + bool shows_tooltip; // Whether the tooltip should be shown on hover. |
| + bool pinned_by_policy; // Whether the item is pinned by policy prefs, the |
| + // user cannot un-pin these items. |
| }; |