Chromium Code Reviews| Index: ui/chromeos/touch_accessibility_enabler.cc |
| diff --git a/ui/chromeos/touch_accessibility_enabler.cc b/ui/chromeos/touch_accessibility_enabler.cc |
| index 675f396b08ec9b87654a3dda06eb868bc62a2412..7432ed59ea079c0a80d3c0bf6c74abc31ac6e74f 100644 |
| --- a/ui/chromeos/touch_accessibility_enabler.cc |
| +++ b/ui/chromeos/touch_accessibility_enabler.cc |
| @@ -9,6 +9,7 @@ |
| #include <utility> |
| #include "base/logging.h" |
| +#include "base/metrics/user_metrics.h" |
| #include "base/time/default_tick_clock.h" |
| #include "ui/aura/window.h" |
| #include "ui/aura/window_event_dispatcher.h" |
| @@ -24,8 +25,11 @@ namespace { |
| // Delay between timer callbacks. Each one plays a tick sound. |
| constexpr int kTimerDelayInMS = 500; |
| +// The number of ticks of the timer before the first sound is generated. |
| +constexpr int kTimerTicksOfFirstSoundFeedback = 6; |
| + |
| // The number of ticks of the timer before toggling spoken feedback. |
| -constexpr int kTimerTicksToToggleSpokenFeedback = 7; |
| +constexpr int kTimerTicksToToggleSpokenFeedback = 10; |
| } // namespace |
| @@ -135,7 +139,13 @@ void TouchAccessibilityEnabler::OnTimer() { |
| double tick_count_f = |
| (now - two_finger_start_time_).InMillisecondsF() / kTimerDelayInMS; |
| int tick_count = roundf(tick_count_f); |
| - if (tick_count >= 1 && tick_count < kTimerTicksToToggleSpokenFeedback) { |
| + |
| + if (tick_count == kTimerTicksOfFirstSoundFeedback) |
|
Ilya Sherman
2016/11/16 23:11:33
nit: Please add curly braces, since the body of th
oshima
2016/11/22 21:57:38
+1
dmazzoni
2016/11/22 22:31:55
Done.
|
| + base::RecordAction( |
| + base::UserMetricsAction("Accessibility.TwoFingersHeldDown")); |
| + |
| + if (tick_count >= kTimerTicksOfFirstSoundFeedback && |
| + tick_count < kTimerTicksToToggleSpokenFeedback) { |
| delegate_->PlaySpokenFeedbackToggleCountdown(tick_count); |
| } |
| if (tick_count == kTimerTicksToToggleSpokenFeedback) { |