OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_PUBLIC_CPP_SHELF_ITEM_H_ | 5 #ifndef ASH_PUBLIC_CPP_SHELF_ITEM_H_ |
6 #define ASH_PUBLIC_CPP_SHELF_ITEM_H_ | 6 #define ASH_PUBLIC_CPP_SHELF_ITEM_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/public/cpp/app_launch_id.h" | |
11 #include "ash/public/cpp/ash_public_export.h" | 10 #include "ash/public/cpp/ash_public_export.h" |
12 #include "ash/public/cpp/shelf_types.h" | 11 #include "ash/public/cpp/shelf_types.h" |
13 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
14 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
15 | 14 |
16 namespace ash { | 15 namespace ash { |
17 | 16 |
18 struct ASH_PUBLIC_EXPORT ShelfItem { | 17 struct ASH_PUBLIC_EXPORT ShelfItem { |
19 ShelfItem(); | 18 ShelfItem(); |
20 ShelfItem(const ShelfItem& shelf_item); | 19 ShelfItem(const ShelfItem& shelf_item); |
21 ~ShelfItem(); | 20 ~ShelfItem(); |
22 | 21 |
23 ShelfItemType type = TYPE_UNDEFINED; | 22 ShelfItemType type = TYPE_UNDEFINED; |
24 | 23 |
25 // Image to display in the shelf. | 24 // Image to display in the shelf. |
26 gfx::ImageSkia image; | 25 gfx::ImageSkia image; |
27 | 26 |
28 // Assigned by the model when the item is added. | |
29 ShelfID id = kInvalidShelfID; | |
James Cook
2017/05/04 16:38:48
Hooray, less duplicate data!
msw
2017/05/04 19:05:56
Acknowledged.
| |
30 | |
31 // Running status. | 27 // Running status. |
32 ShelfItemStatus status = STATUS_CLOSED; | 28 ShelfItemStatus status = STATUS_CLOSED; |
33 | 29 |
34 // The application id and launch id for this shelf item. | 30 // The application id and launch id for this shelf item. |
35 AppLaunchId app_launch_id; | 31 ShelfID id; |
36 | 32 |
37 // The title to display for tooltips, etc. | 33 // The title to display for tooltips, etc. |
38 base::string16 title; | 34 base::string16 title; |
39 | 35 |
40 // Whether the tooltip should be shown on hover; generally true. | 36 // Whether the tooltip should be shown on hover; generally true. |
41 bool shows_tooltip = true; | 37 bool shows_tooltip = true; |
42 | 38 |
43 // Whether the item is pinned by a policy preference (ie. user cannot un-pin). | 39 // Whether the item is pinned by a policy preference (ie. user cannot un-pin). |
44 bool pinned_by_policy = false; | 40 bool pinned_by_policy = false; |
45 }; | 41 }; |
46 | 42 |
47 typedef std::vector<ShelfItem> ShelfItems; | 43 typedef std::vector<ShelfItem> ShelfItems; |
48 | 44 |
49 } // namespace ash | 45 } // namespace ash |
50 | 46 |
51 #endif // ASH_PUBLIC_CPP_SHELF_ITEM_H_ | 47 #endif // ASH_PUBLIC_CPP_SHELF_ITEM_H_ |
OLD | NEW |