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::PlayEarCon() { | |
61 if (!VolumeAdjustSoundEnabled()) | |
62 return; | |
63 PlaySystemSoundIfSpokenFeedback(chromeos::SOUND_VOLUME_ADJUST); | |
aboxhall
2014/07/24 18:26:34
nit: indentation
lisayin
2014/07/25 20:11:57
Done.
| |
64 } | |
60 void AshTouchExplorationManager::UpdateTouchExplorationState() { | 65 void AshTouchExplorationManager::UpdateTouchExplorationState() { |
61 AccessibilityDelegate* delegate = | 66 AccessibilityDelegate* delegate = |
62 Shell::GetInstance()->accessibility_delegate(); | 67 Shell::GetInstance()->accessibility_delegate(); |
63 bool enabled = delegate->IsSpokenFeedbackEnabled(); | 68 bool enabled = delegate->IsSpokenFeedbackEnabled(); |
64 | 69 |
65 if (enabled && !touch_exploration_controller_.get()) { | 70 if (enabled && !touch_exploration_controller_.get()) { |
66 touch_exploration_controller_.reset(new ui::TouchExplorationController( | 71 touch_exploration_controller_.reset(new ui::TouchExplorationController( |
67 root_window_controller_->GetRootWindow(), this)); | 72 root_window_controller_->GetRootWindow(), this)); |
68 } else if (!enabled) { | 73 } else if (!enabled) { |
69 touch_exploration_controller_.reset(); | 74 touch_exploration_controller_.reset(); |
70 } | 75 } |
71 } | 76 } |
72 | 77 |
73 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { | 78 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { |
74 return !CommandLine::ForCurrentProcess()->HasSwitch( | 79 return !CommandLine::ForCurrentProcess()->HasSwitch( |
75 chromeos::switches::kDisableVolumeAdjustSound); | 80 chromeos::switches::kDisableVolumeAdjustSound); |
76 } | 81 } |
77 | 82 |
78 } // namespace ash | 83 } // namespace ash |
OLD | NEW |