shelf_item.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_CPP_SHELF_ITEM_H_
  5. #define ASH_PUBLIC_CPP_SHELF_ITEM_H_
  6. #include <string>
  7. #include <vector>
  8. #include "ash/public/cpp/ash_public_export.h"
  9. #include "ash/public/cpp/shelf_types.h"
  10. #include "third_party/skia/include/core/SkColor.h"
  11. #include "ui/gfx/image/image_skia.h"
  12. namespace ash {
  13. struct ASH_PUBLIC_EXPORT ShelfItem {
  14. ShelfItem();
  15. ShelfItem(const ShelfItem& shelf_item);
  16. ~ShelfItem();
  17. ShelfItemType type = TYPE_UNDEFINED;
  18. // Image to display in the shelf.
  19. gfx::ImageSkia image;
  20. // Running status.
  21. ShelfItemStatus status = STATUS_CLOSED;
  22. // The application id and launch id for this shelf item.
  23. ShelfID id;
  24. // The title to display for tooltips, etc.
  25. std::u16string title;
  26. SkColor notification_badge_color = SK_ColorWHITE;
  27. // App status.
  28. AppStatus app_status = AppStatus::kReady;
  29. // Whether the item is associated with a window in the currently active desk.
  30. // This value is valid only when |features::kPerDeskShelf| is enabled.
  31. // Otherwise it won't be updated and will always be true.
  32. bool is_on_active_desk = true;
  33. // Whether the tooltip should be shown on hover; generally true.
  34. bool shows_tooltip = true;
  35. // Whether the item is pinned by a policy preference. If so, pin state should
  36. // not be modifiable by user.
  37. bool pinned_by_policy = false;
  38. // Whether the item has a notification.
  39. bool has_notification = false;
  40. };
  41. typedef std::vector<ShelfItem> ShelfItems;
  42. } // namespace ash
  43. #endif // ASH_PUBLIC_CPP_SHELF_ITEM_H_