Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: ui/chromeos/touch_accessibility_enabler.cc

Issue 2504233004: Tweaks for: Toggle spoken feedback if two fingers are held down (Closed)
Patch Set: Update unit tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/metrics/actions/actions.xml ('k') | ui/chromeos/touch_accessibility_enabler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..07d5c80005516624d0102259d5707ff9b41e162c 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,14 @@ 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) {
+ base::RecordAction(
+ base::UserMetricsAction("Accessibility.TwoFingersHeldDown"));
+ }
+
+ if (tick_count >= kTimerTicksOfFirstSoundFeedback &&
+ tick_count < kTimerTicksToToggleSpokenFeedback) {
delegate_->PlaySpokenFeedbackToggleCountdown(tick_count);
}
if (tick_count == kTimerTicksToToggleSpokenFeedback) {
« no previous file with comments | « tools/metrics/actions/actions.xml ('k') | ui/chromeos/touch_accessibility_enabler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698