Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef ASH_SHELF_SHELF_ITEM_TYPES_H_ | 5 #ifndef MASH_SHELF_SHELF_ITEM_TYPES_H_ |
| 6 #define ASH_SHELF_SHELF_ITEM_TYPES_H_ | 6 #define MASH_SHELF_SHELF_ITEM_TYPES_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | |
| 11 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 12 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 13 | 12 |
| 14 namespace ash { | 13 namespace mash { |
| 14 namespace shelf { | |
| 15 | 15 |
| 16 typedef int ShelfID; | 16 typedef int ShelfID; |
| 17 | 17 |
| 18 // The type of a shelf item. | 18 // The type of a shelf item. |
| 19 enum ShelfItemType { | 19 enum ShelfItemType { |
| 20 // Represents a running app panel. | 20 // Represents a running app panel. |
| 21 TYPE_APP_PANEL, | 21 TYPE_APP_PANEL, |
| 22 | 22 |
| 23 // Represents a pinned shortcut to an app. | 23 // Represents a pinned shortcut to an app. |
| 24 TYPE_APP_SHORTCUT, | 24 TYPE_APP_SHORTCUT, |
| 25 | 25 |
| 26 // Toggles visiblity of the app list. | 26 // Toggles visiblity of the app list. |
| 27 TYPE_APP_LIST, | 27 TYPE_APP_LIST, |
| 28 | 28 |
| 29 // The browser shortcut button. | 29 // The browser shortcut button. |
| 30 TYPE_BROWSER_SHORTCUT, | 30 TYPE_BROWSER_SHORTCUT, |
| 31 | 31 |
| 32 // Represents a platform app. | 32 // Represents a platform app. |
| 33 TYPE_PLATFORM_APP, | 33 TYPE_PLATFORM_APP, |
| 34 | 34 |
| 35 // Represents a windowed V1 browser app. | 35 // Represents a windowed V1 browser app. |
| 36 TYPE_WINDOWED_APP, | 36 TYPE_WINDOWED_APP, |
| 37 | 37 |
| 38 // Represents a dialog. | 38 // Represents a dialog. |
| 39 TYPE_DIALOG, | 39 TYPE_DIALOG, |
| 40 | 40 |
| 41 // TODO(msw): Integrate mojo apps with another enum type. | |
| 42 TYPE_MOJO_APP, | |
| 43 | |
| 41 // Default value. | 44 // Default value. |
| 42 TYPE_UNDEFINED, | 45 TYPE_UNDEFINED, |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 // Represents the status of applications in the shelf. | 48 // Represents the status of applications in the shelf. |
| 46 enum ShelfItemStatus { | 49 enum ShelfItemStatus { |
| 47 // A closed shelf item, i.e. has no live instance. | 50 // A closed shelf item, i.e. has no live instance. |
| 48 STATUS_CLOSED, | 51 STATUS_CLOSED, |
| 49 // A shelf item that has live instance. | 52 // A shelf item that has live instance. |
| 50 STATUS_RUNNING, | 53 STATUS_RUNNING, |
| 51 // An active shelf item that has focus. | 54 // An active shelf item that has focus. |
| 52 STATUS_ACTIVE, | 55 STATUS_ACTIVE, |
| 53 // A shelf item that needs user's attention. | 56 // A shelf item that needs user's attention. |
| 54 STATUS_ATTENTION, | 57 STATUS_ATTENTION, |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 struct ASH_EXPORT ShelfItem { | 60 struct ShelfItem { |
| 58 ShelfItem(); | 61 ShelfItem(); |
| 59 ~ShelfItem(); | 62 ~ShelfItem(); |
| 60 | 63 |
| 61 ShelfItemType type; | 64 ShelfItemType type; |
| 62 | 65 |
| 63 // Image to display in the shelf. | 66 // Image to display in the shelf. |
| 64 gfx::ImageSkia image; | 67 gfx::ImageSkia image; |
| 65 | 68 |
| 66 // Assigned by the model when the item is added. | 69 // Assigned by the model when the item is added. |
| 67 ShelfID id; | 70 ShelfID id; |
| 68 | 71 |
| 69 // Running status. | 72 // Running status. |
| 70 ShelfItemStatus status; | 73 ShelfItemStatus status; |
| 71 }; | |
| 72 | 74 |
| 73 typedef std::vector<ShelfItem> ShelfItems; | 75 // The id of an associated open window. |
| 74 | 76 // TODO(msw): Support multiple open windows per button. |
|
msw
2016/01/27 07:43:41
comment
| |
| 75 // ShelfItemDetails may be set on Window (by way of | 77 uint32_t window_id; |
| 76 // SetShelfItemDetailsForWindow) to make the window appear in the shelf. See | |
| 77 // ShelfWindowWatcher for details. | |
| 78 struct ASH_EXPORT ShelfItemDetails { | |
| 79 ShelfItemDetails(); | |
| 80 ~ShelfItemDetails(); | |
| 81 | |
| 82 ShelfItemType type; | |
| 83 | 78 |
| 84 // Resource id of the image to display on the shelf. | 79 // Resource id of the image to display on the shelf. |
| 85 int image_resource_id; | 80 // TODO(msw): int image_resource_id; |
|
msw
2016/01/27 07:43:41
comment
| |
| 86 | 81 |
| 87 // Title of the item. | 82 // Title of the item. |
| 88 base::string16 title; | 83 base::string16 title; |
| 89 }; | 84 }; |
| 90 | 85 |
| 91 } // namespace ash | 86 typedef std::vector<ShelfItem> ShelfItems; |
| 92 | 87 |
| 93 #endif // ASH_SHELF_SHELF_ITEM_TYPES_H_ | 88 } // namespace shelf |
| 89 } // namespace mash | |
| 90 | |
| 91 #endif // MASH_SHELF_SHELF_ITEM_TYPES_H_ | |
| OLD | NEW |