| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/audio/sounds.h" | |
| 6 | |
| 7 #include "ash/common/accessibility_delegate.h" | |
| 8 #include "ash/common/ash_switches.h" | |
| 9 #include "ash/common/wm_shell.h" | |
| 10 #include "base/command_line.h" | |
| 11 | |
| 12 using media::SoundsManager; | |
| 13 | |
| 14 namespace ash { | |
| 15 | |
| 16 bool PlaySystemSoundAlways(SoundsManager::SoundKey key) { | |
| 17 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 18 switches::kAshDisableSystemSounds)) | |
| 19 return false; | |
| 20 return SoundsManager::Get()->Play(key); | |
| 21 } | |
| 22 | |
| 23 bool PlaySystemSoundIfSpokenFeedback(SoundsManager::SoundKey key) { | |
| 24 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | |
| 25 if (cl->HasSwitch(switches::kAshDisableSystemSounds)) | |
| 26 return false; | |
| 27 | |
| 28 if (cl->HasSwitch(switches::kAshEnableSystemSounds)) | |
| 29 return SoundsManager::Get()->Play(key); | |
| 30 | |
| 31 if (!WmShell::Get()->GetAccessibilityDelegate()->IsSpokenFeedbackEnabled()) | |
| 32 return false; | |
| 33 | |
| 34 return SoundsManager::Get()->Play(key); | |
| 35 } | |
| 36 | |
| 37 } // namespace ash | |
| OLD | NEW |