| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/ash_touch_exploration_manager_chromeos.h" | 5 #include "ash/ash_touch_exploration_manager_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_root_window_controller_aura.h" | 7 #include "ash/aura/wm_root_window_controller_aura.h" |
| 8 #include "ash/common/accessibility_delegate.h" | 8 #include "ash/common/accessibility_delegate.h" |
| 9 #include "ash/common/system/tray/system_tray_notifier.h" | 9 #include "ash/common/system/tray/system_tray_notifier.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void AshTouchExplorationManager::OnDisplayMetricsChanged( | 95 void AshTouchExplorationManager::OnDisplayMetricsChanged( |
| 96 const display::Display& display, | 96 const display::Display& display, |
| 97 uint32_t changed_metrics) { | 97 uint32_t changed_metrics) { |
| 98 if (root_window_controller_->wm_root_window_controller() | 98 if (root_window_controller_->wm_root_window_controller() |
| 99 ->GetWindow() | 99 ->GetWindow() |
| 100 ->GetDisplayNearestWindow() | 100 ->GetDisplayNearestWindow() |
| 101 .id() == display.id()) | 101 .id() == display.id()) |
| 102 UpdateTouchExplorationState(); | 102 UpdateTouchExplorationState(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void AshTouchExplorationManager::PlaySpokenFeedbackToggleCountdown( |
| 106 int tick_count) { |
| 107 WmShell::Get()->accessibility_delegate()->PlaySpokenFeedbackToggleCountdown( |
| 108 tick_count); |
| 109 } |
| 110 |
| 111 void AshTouchExplorationManager::ToggleSpokenFeedback() { |
| 112 WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( |
| 113 ash::A11Y_NOTIFICATION_SHOW); |
| 114 } |
| 115 |
| 105 void AshTouchExplorationManager::OnWindowActivated( | 116 void AshTouchExplorationManager::OnWindowActivated( |
| 106 aura::client::ActivationChangeObserver::ActivationReason reason, | 117 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 107 aura::Window* gained_active, | 118 aura::Window* gained_active, |
| 108 aura::Window* lost_active) { | 119 aura::Window* lost_active) { |
| 109 UpdateTouchExplorationState(); | 120 UpdateTouchExplorationState(); |
| 110 } | 121 } |
| 111 | 122 |
| 112 void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint( | 123 void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint( |
| 113 const gfx::Point& anchor_point) { | 124 const gfx::Point& anchor_point) { |
| 114 if (touch_exploration_controller_) { | 125 if (touch_exploration_controller_) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 143 .work_area(); | 154 .work_area(); |
| 144 touch_exploration_controller_->SetExcludeBounds(work_area); | 155 touch_exploration_controller_->SetExcludeBounds(work_area); |
| 145 SilenceSpokenFeedback(); | 156 SilenceSpokenFeedback(); |
| 146 WmShell::Get()->accessibility_delegate()->ClearFocusHighlight(); | 157 WmShell::Get()->accessibility_delegate()->ClearFocusHighlight(); |
| 147 } else { | 158 } else { |
| 148 touch_exploration_controller_->SetExcludeBounds(gfx::Rect()); | 159 touch_exploration_controller_->SetExcludeBounds(gfx::Rect()); |
| 149 } | 160 } |
| 150 } else { | 161 } else { |
| 151 touch_exploration_controller_.reset(); | 162 touch_exploration_controller_.reset(); |
| 152 } | 163 } |
| 164 |
| 165 if (!touch_accessibility_enabler_) { |
| 166 // Always enable gesture to toggle spoken feedback. |
| 167 touch_accessibility_enabler_.reset(new ui::TouchAccessibilityEnabler( |
| 168 root_window_controller_->GetRootWindow(), this)); |
| 169 } |
| 153 } | 170 } |
| 154 | 171 |
| 155 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { | 172 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { |
| 156 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 173 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 157 chromeos::switches::kDisableVolumeAdjustSound); | 174 chromeos::switches::kDisableVolumeAdjustSound); |
| 158 } | 175 } |
| 159 | 176 |
| 160 } // namespace ash | 177 } // namespace ash |
| OLD | NEW |