scoped_backlights_forced_off.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2017 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_SYSTEM_POWER_SCOPED_BACKLIGHTS_FORCED_OFF_H_
  5. #define ASH_SYSTEM_POWER_SCOPED_BACKLIGHTS_FORCED_OFF_H_
  6. #include "ash/ash_export.h"
  7. #include "base/callback.h"
  8. namespace ash {
  9. // RAII-style class used to force the backlights off.
  10. // Returned by BacklightsForcedOffSetter::ForceBacklightsOff.
  11. class ASH_EXPORT ScopedBacklightsForcedOff {
  12. public:
  13. explicit ScopedBacklightsForcedOff(base::OnceClosure unregister_callback);
  14. ScopedBacklightsForcedOff(const ScopedBacklightsForcedOff&) = delete;
  15. ScopedBacklightsForcedOff& operator=(const ScopedBacklightsForcedOff&) =
  16. delete;
  17. ~ScopedBacklightsForcedOff();
  18. private:
  19. // Callback that should be called in order for |this| to unregister backlights
  20. // forced off request.
  21. base::OnceClosure unregister_callback_;
  22. };
  23. } // namespace ash
  24. #endif // ASH_SYSTEM_POWER_SCOPED_BACKLIGHTS_FORCED_OFF_H_