mock_touch_exploration_controller_delegate.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_ACCESSIBILITY_CHROMEVOX_MOCK_TOUCH_EXPLORATION_CONTROLLER_DELEGATE_H_
  5. #define ASH_ACCESSIBILITY_CHROMEVOX_MOCK_TOUCH_EXPLORATION_CONTROLLER_DELEGATE_H_
  6. #include "ash/accessibility/chromevox/touch_exploration_controller.h"
  7. #include "ui/accessibility/ax_enums.mojom.h"
  8. namespace ash {
  9. class MockTouchExplorationControllerDelegate
  10. : public TouchExplorationControllerDelegate {
  11. public:
  12. MockTouchExplorationControllerDelegate();
  13. ~MockTouchExplorationControllerDelegate() override;
  14. // TouchExplorationControllerDelegate:
  15. void SetOutputLevel(int volume) override;
  16. void SilenceSpokenFeedback() override;
  17. void PlayVolumeAdjustEarcon() override;
  18. void PlayPassthroughEarcon() override;
  19. void PlayLongPressRightClickEarcon() override;
  20. void PlayEnterScreenEarcon() override;
  21. void PlayTouchTypeEarcon() override;
  22. void HandleAccessibilityGesture(ax::mojom::Gesture gesture,
  23. gfx::PointF location) override;
  24. const std::vector<float> VolumeChanges() const;
  25. size_t NumAdjustSounds() const;
  26. size_t NumPassthroughSounds() const;
  27. size_t NumLongPressRightClickSounds() const;
  28. size_t NumEnterScreenSounds() const;
  29. size_t NumTouchTypeSounds() const;
  30. ax::mojom::Gesture GetLastGesture() const;
  31. void ResetLastGesture();
  32. std::vector<gfx::Point>& GetTouchExplorePoints();
  33. void ResetCountersToZero();
  34. private:
  35. std::vector<float> volume_changes_;
  36. size_t num_times_adjust_sound_played_ = 0;
  37. size_t num_times_passthrough_played_ = 0;
  38. size_t num_times_long_press_right_click_played_ = 0;
  39. size_t num_times_enter_screen_played_ = 0;
  40. size_t num_times_touch_type_sound_played_ = 0;
  41. ax::mojom::Gesture last_gesture_ = ax::mojom::Gesture::kNone;
  42. std::vector<gfx::Point> touch_explore_points_;
  43. };
  44. } // namespace ash
  45. #endif // ASH_ACCESSIBILITY_CHROMEVOX_MOCK_TOUCH_EXPLORATION_CONTROLLER_DELEGATE_H_