notification_view_controller.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2021 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 UI_MESSAGE_CENTER_NOTIFICATION_VIEW_CONTROLLER_H_
  5. #define UI_MESSAGE_CENTER_NOTIFICATION_VIEW_CONTROLLER_H_
  6. #include <string>
  7. #include "ui/message_center/message_center_export.h"
  8. namespace message_center {
  9. class MessageView;
  10. // A controller class to manage adding, removing and updating group
  11. // notifications.
  12. class MESSAGE_CENTER_EXPORT NotificationViewController {
  13. public:
  14. // Returns the `MessageView` associated with `notification_id`
  15. virtual MessageView* GetMessageViewForNotificationId(
  16. const std::string& notification_id) = 0;
  17. // Animate all notification views after a resize.
  18. virtual void AnimateResize() = 0;
  19. // Updates the notification id associated with a `MessageCenterView` and
  20. // popup if required. We do this to covert an existing message view into
  21. // a message view that acts as a container for grouped notifications.
  22. // Creating a new view for this would make the code simpler but we need
  23. // to do it in place to make it easier to animate the conversion between
  24. // grouped and non-grouped notifications.
  25. virtual void ConvertNotificationViewToGroupedNotificationView(
  26. const std::string& ungrouped_notification_id,
  27. const std::string& new_grouped_notification_id) = 0;
  28. // Updates the notification id associated with a `MessageCenterView` and
  29. // popup if needed. This is done to convert an existing grouped notification
  30. // view back into a single notification view.
  31. virtual void ConvertGroupedNotificationViewToNotificationView(
  32. const std::string& grouped_notification_id,
  33. const std::string& new_single_notification_id) = 0;
  34. };
  35. } // namespace message_center
  36. #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_