notifier_settings_controller.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2019 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_NOTIFIER_SETTINGS_CONTROLLER_H_
  5. #define ASH_PUBLIC_CPP_NOTIFIER_SETTINGS_CONTROLLER_H_
  6. #include "ash/public/cpp/ash_public_export.h"
  7. namespace message_center {
  8. struct NotifierId;
  9. }
  10. namespace ash {
  11. class NotifierSettingsObserver;
  12. // An interface, implemented by Chrome, which allows Ash to read and write
  13. // settings and UI data regarding message center notification sources.
  14. class ASH_PUBLIC_EXPORT NotifierSettingsController {
  15. public:
  16. // Returns the singleton instance.
  17. static NotifierSettingsController* Get();
  18. NotifierSettingsController(const NotifierSettingsController&) = delete;
  19. NotifierSettingsController& operator=(const NotifierSettingsController&) =
  20. delete;
  21. // Assembles the list of active notifiers and updates all
  22. // NotifierSettingsObservers via OnNotifiersUpdated.
  23. virtual void GetNotifiers() = 0;
  24. // Called to toggle the |enabled| state of a specific notifier (in response to
  25. // a user selecting or de-selecting that notifier).
  26. virtual void SetNotifierEnabled(const message_center::NotifierId& notifier_id,
  27. bool enabled) = 0;
  28. virtual void AddNotifierSettingsObserver(
  29. NotifierSettingsObserver* listener) = 0;
  30. virtual void RemoveNotifierSettingsObserver(
  31. NotifierSettingsObserver* listener) = 0;
  32. protected:
  33. NotifierSettingsController();
  34. virtual ~NotifierSettingsController();
  35. };
  36. } // namespace ash
  37. #endif // ASH_PUBLIC_CPP_NOTIFIER_SETTINGS_CONTROLLER_H_