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

Unified Diff: ash/ash_touch_exploration_manager_chromeos.cc

Issue 2584063002: Re-land: Toggle spoken feedback if two fingers are held down. (Closed)
Patch Set: Only toggle spoken feedback on CFM devices Created 4 years 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 | « ash/ash_touch_exploration_manager_chromeos.h ('k') | ash/common/accessibility_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/ash_touch_exploration_manager_chromeos.cc
diff --git a/ash/ash_touch_exploration_manager_chromeos.cc b/ash/ash_touch_exploration_manager_chromeos.cc
index 3438d27524c2edaa9165370bfd5c9b082ea12e89..c5bf8dd6e656e936caf5d50ff76f13cb3b493a9a 100644
--- a/ash/ash_touch_exploration_manager_chromeos.cc
+++ b/ash/ash_touch_exploration_manager_chromeos.cc
@@ -102,6 +102,19 @@ void AshTouchExplorationManager::OnDisplayMetricsChanged(
UpdateTouchExplorationState();
}
+void AshTouchExplorationManager::PlaySpokenFeedbackToggleCountdown(
+ int tick_count) {
+ AccessibilityDelegate* delegate = WmShell::Get()->accessibility_delegate();
+ if (delegate->ShouldToggleSpokenFeedbackViaTouch())
+ delegate->PlaySpokenFeedbackToggleCountdown(tick_count);
+}
+
+void AshTouchExplorationManager::ToggleSpokenFeedback() {
+ AccessibilityDelegate* delegate = WmShell::Get()->accessibility_delegate();
+ if (delegate->ShouldToggleSpokenFeedbackViaTouch())
+ delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_SHOW);
+}
+
void AshTouchExplorationManager::OnWindowActivated(
aura::client::ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
@@ -129,11 +142,18 @@ void AshTouchExplorationManager::UpdateTouchExplorationState() {
const bool spoken_feedback_enabled =
WmShell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled();
+ if (!touch_accessibility_enabler_) {
+ // Always enable gesture to toggle spoken feedback.
+ touch_accessibility_enabler_.reset(new ui::TouchAccessibilityEnabler(
+ root_window_controller_->GetRootWindow(), this));
+ }
+
if (spoken_feedback_enabled) {
if (!touch_exploration_controller_.get()) {
touch_exploration_controller_ =
base::MakeUnique<ui::TouchExplorationController>(
- root_window_controller_->GetRootWindow(), this);
+ root_window_controller_->GetRootWindow(), this,
+ touch_accessibility_enabler_.get());
}
if (pass_through_surface) {
const gfx::Rect& work_area =
« no previous file with comments | « ash/ash_touch_exploration_manager_chromeos.h ('k') | ash/common/accessibility_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698