notification.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2018 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 COMPONENTS_EXO_NOTIFICATION_H_
  5. #define COMPONENTS_EXO_NOTIFICATION_H_
  6. #include <string>
  7. #include <vector>
  8. #include "base/callback.h"
  9. #include "third_party/abseil-cpp/absl/types/optional.h"
  10. namespace exo {
  11. // Handles notification shown in message center.
  12. class Notification {
  13. public:
  14. Notification(const std::string& title,
  15. const std::string& message,
  16. const std::string& display_source,
  17. const std::string& notification_id,
  18. const std::string& notifier_id,
  19. const std::vector<std::string>& buttons,
  20. const base::RepeatingCallback<void(bool)>& close_callback,
  21. const base::RepeatingCallback<void(const absl::optional<int>&)>&
  22. click_callback);
  23. Notification(const Notification&) = delete;
  24. Notification& operator=(const Notification&) = delete;
  25. // Closes this notification.
  26. void Close();
  27. private:
  28. const std::string notification_id_;
  29. };
  30. } // namespace exo
  31. #endif // COMPONENTS_EXO_NOTIFICATION_H_