tray_utils.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright (c) 2012 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_SYSTEM_TRAY_TRAY_UTILS_H_
  5. #define ASH_SYSTEM_TRAY_TRAY_UTILS_H_
  6. #include <cstdint>
  7. #include "ash/system/tray/tray_popup_ink_drop_style.h"
  8. #include "components/session_manager/session_manager_types.h"
  9. #include "third_party/abseil-cpp/absl/types/optional.h"
  10. #include "third_party/skia/include/core/SkColor.h"
  11. #include "ui/gfx/geometry/insets.h"
  12. namespace views {
  13. class Label;
  14. }
  15. namespace ash {
  16. class HoverHighlightView;
  17. // Sets up a Label properly for the tray (sets color, font etc.).
  18. void SetupLabelForTray(views::Label* label);
  19. // Adds connected sub label to the |view| with appropriate style and updates
  20. // accessibility label.
  21. void SetupConnectedScrollListItem(HoverHighlightView* view);
  22. // Adds connected sub label with the device's battery percentage to the |view|
  23. // with appropriate style and updates accessibility label.
  24. void SetupConnectedScrollListItem(HoverHighlightView* view,
  25. absl::optional<uint8_t> battery_percentage);
  26. // Adds connecting sub label to the |view| with appropriate style and updates
  27. // accessibility label.
  28. void SetupConnectingScrollListItem(HoverHighlightView* view);
  29. // Gets the current tray icon color for the given session state.
  30. SkColor TrayIconColor(session_manager::SessionState session_state);
  31. // Returns the insets above the shelf for positioning the quick settings bubble.
  32. gfx::Insets GetTrayBubbleInsets();
  33. // Calculates the height compensations in tablet mode based on whether the
  34. // hotseat is shown.
  35. int GetBubbleInsetHotseatCompensation();
  36. // Returns the separation above the shelf for positioning secondary tray
  37. // bubbles. (Palette Tray, IME Tray).
  38. gfx::Insets GetSecondaryBubbleInsets();
  39. // Gets the InkDrop insets based on `ink_drop_style`.
  40. gfx::Insets GetInkDropInsets(TrayPopupInkDropStyle ink_drop_style);
  41. } // namespace ash
  42. #endif // ASH_SYSTEM_TRAY_TRAY_UTILS_H_