spoken_feedback_enabler.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 ASH_ACCESSIBILITY_CHROMEVOX_SPOKEN_FEEDBACK_ENABLER_H_
  5. #define ASH_ACCESSIBILITY_CHROMEVOX_SPOKEN_FEEDBACK_ENABLER_H_
  6. #include "ash/ash_export.h"
  7. #include "base/time/time.h"
  8. #include "base/timer/timer.h"
  9. namespace ash {
  10. // A class that enables ChromeVox based on a timer, providing progress
  11. // sound feedback.
  12. class ASH_EXPORT SpokenFeedbackEnabler {
  13. public:
  14. SpokenFeedbackEnabler();
  15. SpokenFeedbackEnabler(const SpokenFeedbackEnabler&) = delete;
  16. SpokenFeedbackEnabler& operator=(const SpokenFeedbackEnabler&) = delete;
  17. ~SpokenFeedbackEnabler();
  18. private:
  19. // Handles ticks of the timer.
  20. void OnTimer();
  21. // The start time.
  22. base::TimeTicks start_time_;
  23. // A timer that triggers repeatedly until either cancel or the desired time
  24. // elapsed.
  25. base::RepeatingTimer timer_;
  26. };
  27. } // namespace ash
  28. #endif // ASH_ACCESSIBILITY_CHROMEVOX_SPOKEN_FEEDBACK_ENABLER_H_