do_not_disturb_controller_impl.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2020 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_COMPONENTS_PHONEHUB_DO_NOT_DISTURB_CONTROLLER_IMPL_H_
  5. #define ASH_COMPONENTS_PHONEHUB_DO_NOT_DISTURB_CONTROLLER_IMPL_H_
  6. #include "ash/components/phonehub/do_not_disturb_controller.h"
  7. namespace ash {
  8. namespace phonehub {
  9. class MessageSender;
  10. class UserActionRecorder;
  11. // Responsible for sending and receiving states in regards to the DoNotDisturb
  12. // feature of the user's remote phone.
  13. class DoNotDisturbControllerImpl : public DoNotDisturbController {
  14. public:
  15. DoNotDisturbControllerImpl(MessageSender* message_sender,
  16. UserActionRecorder* user_action_recorder);
  17. ~DoNotDisturbControllerImpl() override;
  18. private:
  19. friend class DoNotDisturbControllerImplTest;
  20. // DoNotDisturbController:
  21. bool IsDndEnabled() const override;
  22. void SetDoNotDisturbStateInternal(bool is_dnd_enabled,
  23. bool can_request_new_dnd_state) override;
  24. void RequestNewDoNotDisturbState(bool enabled) override;
  25. bool CanRequestNewDndState() const override;
  26. MessageSender* message_sender_;
  27. UserActionRecorder* user_action_recorder_;
  28. bool is_dnd_enabled_ = false;
  29. bool can_request_new_dnd_state_ = false;
  30. };
  31. } // namespace phonehub
  32. } // namespace ash
  33. #endif // ASH_COMPONENTS_PHONEHUB_DO_NOT_DISTURB_CONTROLLER_IMPL_H_