1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/accessibility/chromevox/mock_touch_exploration_controller_delegate.h"
namespace ash {
MockTouchExplorationControllerDelegate::
MockTouchExplorationControllerDelegate() = default;
MockTouchExplorationControllerDelegate::
~MockTouchExplorationControllerDelegate() = default;
void MockTouchExplorationControllerDelegate::SetOutputLevel(int volume) {
volume_changes_.push_back(volume);
}
void MockTouchExplorationControllerDelegate::SilenceSpokenFeedback() {}
void MockTouchExplorationControllerDelegate::PlayVolumeAdjustEarcon() {
++num_times_adjust_sound_played_;
}
void MockTouchExplorationControllerDelegate::PlayPassthroughEarcon() {
++num_times_passthrough_played_;
}
void MockTouchExplorationControllerDelegate::PlayLongPressRightClickEarcon() {
++num_times_long_press_right_click_played_;
}
void MockTouchExplorationControllerDelegate::PlayEnterScreenEarcon() {
++num_times_enter_screen_played_;
}
void MockTouchExplorationControllerDelegate::PlayTouchTypeEarcon() {
++num_times_touch_type_sound_played_;
}
void MockTouchExplorationControllerDelegate::HandleAccessibilityGesture(
ax::mojom::Gesture gesture,
gfx::PointF location) {
last_gesture_ = gesture;
if (gesture == ax::mojom::Gesture::kTouchExplore)
touch_explore_points_.push_back(gfx::Point(location.x(), location.y()));
}
const std::vector<float> MockTouchExplorationControllerDelegate::VolumeChanges()
const {
return volume_changes_;
}
size_t MockTouchExplorationControllerDelegate::NumAdjustSounds() const {
return num_times_adjust_sound_played_;
}
size_t MockTouchExplorationControllerDelegate::NumPassthroughSounds() const {
return num_times_passthrough_played_;
}
size_t MockTouchExplorationControllerDelegate::NumLongPressRightClickSounds()
const {
return num_times_long_press_right_click_played_;
}
size_t MockTouchExplorationControllerDelegate::NumEnterScreenSounds() const {
return num_times_enter_screen_played_;
}
size_t MockTouchExplorationControllerDelegate::NumTouchTypeSounds() const {
return num_times_touch_type_sound_played_;
}
ax::mojom::Gesture MockTouchExplorationControllerDelegate::GetLastGesture()
const {
return last_gesture_;
}
void MockTouchExplorationControllerDelegate::ResetLastGesture() {
last_gesture_ = ax::mojom::Gesture::kNone;
}
std::vector<gfx::Point>&
MockTouchExplorationControllerDelegate::GetTouchExplorePoints() {
return touch_explore_points_;
}
void MockTouchExplorationControllerDelegate::ResetCountersToZero() {
num_times_adjust_sound_played_ = 0;
num_times_passthrough_played_ = 0;
num_times_long_press_right_click_played_ = 0;
num_times_enter_screen_played_ = 0;
num_times_touch_type_sound_played_ = 0;
}
} // namespace ash
|