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/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
8 #include "ash/audio/sounds.h" | 8 #include "ash/audio/sounds.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if (audio_handler_->IsOutputMuted()) { | 50 if (audio_handler_->IsOutputMuted()) { |
51 audio_handler_->SetOutputMute(false); | 51 audio_handler_->SetOutputMute(false); |
52 } | 52 } |
53 } | 53 } |
54 audio_handler_->SetOutputVolumePercent(volume); | 54 audio_handler_->SetOutputVolumePercent(volume); |
55 // Avoid negative volume. | 55 // Avoid negative volume. |
56 if (audio_handler_->IsOutputVolumeBelowDefaultMuteLevel()) | 56 if (audio_handler_->IsOutputVolumeBelowDefaultMuteLevel()) |
57 audio_handler_->SetOutputMute(true); | 57 audio_handler_->SetOutputMute(true); |
58 } | 58 } |
59 | 59 |
| 60 void AshTouchExplorationManager::SilenceSpokenFeedback() { |
| 61 AccessibilityDelegate* delegate = |
| 62 Shell::GetInstance()->accessibility_delegate(); |
| 63 if (!delegate->IsSpokenFeedbackEnabled()) |
| 64 return; |
| 65 delegate->SilenceSpokenFeedback(); |
| 66 } |
| 67 |
60 void AshTouchExplorationManager::UpdateTouchExplorationState() { | 68 void AshTouchExplorationManager::UpdateTouchExplorationState() { |
61 AccessibilityDelegate* delegate = | 69 AccessibilityDelegate* delegate = |
62 Shell::GetInstance()->accessibility_delegate(); | 70 Shell::GetInstance()->accessibility_delegate(); |
63 bool enabled = delegate->IsSpokenFeedbackEnabled(); | 71 bool enabled = delegate->IsSpokenFeedbackEnabled(); |
64 | 72 |
65 if (enabled && !touch_exploration_controller_.get()) { | 73 if (enabled && !touch_exploration_controller_.get()) { |
66 touch_exploration_controller_.reset(new ui::TouchExplorationController( | 74 touch_exploration_controller_.reset(new ui::TouchExplorationController( |
67 root_window_controller_->GetRootWindow(), this)); | 75 root_window_controller_->GetRootWindow(), this)); |
68 } else if (!enabled) { | 76 } else if (!enabled) { |
69 touch_exploration_controller_.reset(); | 77 touch_exploration_controller_.reset(); |
70 } | 78 } |
71 } | 79 } |
72 | 80 |
73 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { | 81 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { |
74 return !CommandLine::ForCurrentProcess()->HasSwitch( | 82 return !CommandLine::ForCurrentProcess()->HasSwitch( |
75 chromeos::switches::kDisableVolumeAdjustSound); | 83 chromeos::switches::kDisableVolumeAdjustSound); |
76 } | 84 } |
77 | 85 |
78 } // namespace ash | 86 } // namespace ash |
OLD | NEW |