Chromium Code Reviews| Index: chrome/browser/chromeos/accessibility/accessibility_manager.cc |
| diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc |
| index fe448ff44ee1c26008faa9449737dc071db1479d..94521ee718a91ccc977ddc3181e68016ef660a78 100644 |
| --- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc |
| +++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc |
| @@ -295,6 +295,12 @@ AccessibilityManager::AccessibilityManager() |
| bundle.GetRawDataResource(IDR_SOUND_EXIT_SCREEN_WAV)); |
| manager->Initialize(SOUND_ENTER_SCREEN, |
| bundle.GetRawDataResource(IDR_SOUND_ENTER_SCREEN_WAV)); |
| + manager->Initialize(SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_HIGH, |
| + bundle.GetRawDataResource( |
| + IDR_SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_HIGH_WAV)); |
| + manager->Initialize(SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_LOW, |
| + bundle.GetRawDataResource( |
| + IDR_SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_LOW_WAV)); |
| base::FilePath resources_path; |
| if (!PathService::Get(chrome::DIR_RESOURCES, &resources_path)) |
| @@ -542,8 +548,9 @@ void AccessibilityManager::OnLocaleChanged() { |
| bool AccessibilityManager::PlayEarcon(int sound_key, PlaySoundOption option) { |
| DCHECK(sound_key < chromeos::SOUND_COUNT); |
| base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); |
| - if (cl->HasSwitch(kAshDisableSystemSounds)) |
| + if (cl->HasSwitch(kAshDisableSystemSounds)) { |
| return false; |
| + } |
|
oshima
2016/11/08 18:14:43
nuke {}
dmazzoni
2016/11/08 20:43:47
Done.
|
| if (option == PlaySoundOption::SPOKEN_FEEDBACK_ENABLED && |
| !IsSpokenFeedbackEnabled() && !cl->HasSwitch(kAshEnableSystemSounds)) { |
| return false; |
| @@ -551,6 +558,16 @@ bool AccessibilityManager::PlayEarcon(int sound_key, PlaySoundOption option) { |
| return media::SoundsManager::Get()->Play(sound_key); |
| } |
| +bool AccessibilityManager::PlaySpokenFeedbackToggleCountdown(int tick_count) { |
| + // When the user holds down two fingers on a touch screen, play |
| + // alternating high and low tick sounds to warn the user that something |
| + // is going to happen, until the elapsed time has passed to enable |
| + // spoken feedback. |
|
oshima
2016/11/08 18:14:43
and consolidate this with the comment in the heade
dmazzoni
2016/11/08 20:43:47
Removed this one, I'll just leave the main comment
|
| + return media::SoundsManager::Get()->Play( |
| + tick_count % 2 ? SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_HIGH |
| + : SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_LOW); |
| +} |
| + |
| void AccessibilityManager::HandleAccessibilityGesture(ui::AXGesture gesture) { |
| extensions::EventRouter* event_router = |
| extensions::EventRouter::Get(profile()); |