| 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/audio/sounds.h" | 7 #include "ash/audio/sounds.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 audio_handler_->SetOutputVolumePercent(volume); | 51 audio_handler_->SetOutputVolumePercent(volume); |
| 52 // Avoid negative volume. | 52 // Avoid negative volume. |
| 53 if (audio_handler_->IsOutputVolumeBelowDefaultMuteLevel()) | 53 if (audio_handler_->IsOutputVolumeBelowDefaultMuteLevel()) |
| 54 audio_handler_->SetOutputMute(true); | 54 audio_handler_->SetOutputMute(true); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void AshTouchExplorationManager::SilenceSpokenFeedback() { | 57 void AshTouchExplorationManager::SilenceSpokenFeedback() { |
| 58 AccessibilityDelegate* delegate = | 58 AccessibilityDelegate* delegate = |
| 59 Shell::GetInstance()->accessibility_delegate(); | 59 Shell::GetInstance()->accessibility_delegate(); |
| 60 if (!delegate->IsSpokenFeedbackEnabled()) | 60 if (!delegate->IsSpokenFeedbackEnabled()) |
| 61 return; | 61 return; |
| 62 delegate->SilenceSpokenFeedback(); | 62 delegate->SilenceSpokenFeedback(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void AshTouchExplorationManager::PlayVolumeAdjustEarcon() { | 65 void AshTouchExplorationManager::PlayVolumeAdjustEarcon() { |
| 66 if (!VolumeAdjustSoundEnabled()) | 66 if (!VolumeAdjustSoundEnabled()) |
| 67 return; | 67 return; |
| 68 if (!audio_handler_->IsOutputMuted() && | 68 if (!audio_handler_->IsOutputMuted() && |
| 69 audio_handler_->GetOutputVolumePercent() != 100) | 69 audio_handler_->GetOutputVolumePercent() != 100) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 touch_exploration_controller_.reset(); | 127 touch_exploration_controller_.reset(); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { | 131 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { |
| 132 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 132 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 133 chromeos::switches::kDisableVolumeAdjustSound); | 133 chromeos::switches::kDisableVolumeAdjustSound); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace ash | 136 } // namespace ash |
| OLD | NEW |