screen_state_enabled_provider.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_SCREEN_STATE_ENABLED_PROVIDER_H_
  5. #define ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_SCREEN_STATE_ENABLED_PROVIDER_H_
  6. #include "ash/quick_pair/feature_status_tracker/base_enabled_provider.h"
  7. #include "base/scoped_observation.h"
  8. #include "ui/display/manager/display_configurator.h"
  9. namespace ash {
  10. namespace quick_pair {
  11. // Observes whether the screen state of any display is on.
  12. class ScreenStateEnabledProvider
  13. : public BaseEnabledProvider,
  14. public display::DisplayConfigurator::Observer {
  15. public:
  16. ScreenStateEnabledProvider();
  17. ~ScreenStateEnabledProvider() override;
  18. // display::DisplayConfigurator::Observer
  19. void OnDisplayModeChanged(
  20. const display::DisplayConfigurator::DisplayStateList& display_states)
  21. override;
  22. private:
  23. base::ScopedObservation<display::DisplayConfigurator,
  24. display::DisplayConfigurator::Observer>
  25. configurator_observation_{this};
  26. };
  27. } // namespace quick_pair
  28. } // namespace ash
  29. #endif // ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_SCREEN_STATE_ENABLED_PROVIDER_H_