notification_center_tray.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2022 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_NOTIFICATION_CENTER_NOTIFICATION_CENTER_TRAY_H_
  5. #define ASH_SYSTEM_NOTIFICATION_CENTER_NOTIFICATION_CENTER_TRAY_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/system/tray/tray_background_view.h"
  8. #include "ash/system/unified/notification_icons_controller.h"
  9. #include "ui/base/metadata/metadata_header_macros.h"
  10. namespace views {
  11. class Widget;
  12. } // namespace views
  13. namespace ash {
  14. class Shelf;
  15. class TrayBubbleView;
  16. // A button in the tray which displays the number of currently available
  17. // notifications along with icons for pinned notifications. Clicking this button
  18. // opens a bubble with a scrollable list of all current notifications.
  19. class ASH_EXPORT NotificationCenterTray : public TrayBackgroundView {
  20. public:
  21. METADATA_HEADER(NotificationCenterTray);
  22. explicit NotificationCenterTray(Shelf* shelf);
  23. NotificationCenterTray(const NotificationCenterTray&) = delete;
  24. NotificationCenterTray& operator=(const NotificationCenterTray&) = delete;
  25. ~NotificationCenterTray() override;
  26. // TrayBackgroundView:
  27. std::u16string GetAccessibleNameForTray() override;
  28. void HandleLocaleChange() override;
  29. void HideBubbleWithView(const TrayBubbleView* bubble_view) override;
  30. void ClickedOutsideBubble() override;
  31. void CloseBubble() override;
  32. void ShowBubble() override;
  33. void UpdateAfterLoginStatusChange() override;
  34. TrayBubbleView* GetBubbleView() override;
  35. views::Widget* GetBubbleWidget() const override;
  36. private:
  37. // Manages showing notification icons in the tray.
  38. const std::unique_ptr<NotificationIconsController>
  39. notification_icons_controller_;
  40. // TODO(1311738): Add NotificationCenterBubble.
  41. };
  42. } // namespace ash
  43. #endif // ASH_SYSTEM_NOTIFICATION_CENTER_NOTIFICATION_CENTER_TRAY_H_