Commit cbcb08ed authored by Zach Helfinstein's avatar Zach Helfinstein Committed by Commit Bot

Add dictation cancel earcon

Add a third earcon for dictation cancelled, and modify which earcon
plays when so the user is more aware of the current dictation state.

Bug: 801398
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I3af2dd619e493e7697be5b5628539d9f6a56c7f1
Reviewed-on: https://chromium-review.googlesource.com/1040364Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Zach Helfinstein <zhelfins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555797}
parent 63f82f7b
......@@ -558,6 +558,7 @@
<include name="IDR_SOUND_TOUCH_TYPE_WAV" file="resources\chromeos\sounds\touch_type.wav" type="BINDATA" />
<include name="IDR_SOUND_DICTATION_END_WAV" file="resources\chromeos\sounds\earcons\audio_end.wav" type="BINDATA" />
<include name="IDR_SOUND_DICTATION_START_WAV" file="resources\chromeos\sounds\earcons\audio_initiate.wav" type="BINDATA" />
<include name="IDR_SOUND_DICTATION_CANCEL_WAV" file="resources\chromeos\sounds\earcons\null_selection.wav" type="BINDATA" />
</if>
<if expr="chromeos">
<include name="IDR_ABOUT_POWER_HTML" file="resources\chromeos\power.html" type="BINDATA" />
......
......@@ -237,6 +237,9 @@ AccessibilityManager::AccessibilityManager()
bundle.GetRawDataResource(IDR_SOUND_DICTATION_END_WAV));
manager->Initialize(SOUND_DICTATION_START,
bundle.GetRawDataResource(IDR_SOUND_DICTATION_START_WAV));
manager->Initialize(
SOUND_DICTATION_CANCEL,
bundle.GetRawDataResource(IDR_SOUND_DICTATION_CANCEL_WAV));
base::FilePath resources_path;
if (!PathService::Get(chrome::DIR_RESOURCES, &resources_path))
......
......@@ -35,7 +35,7 @@ DictationChromeos::~DictationChromeos() = default;
bool DictationChromeos::OnToggleDictation() {
if (speech_recognizer_) {
media::SoundsManager::Get()->Play(chromeos::SOUND_DICTATION_END);
media::SoundsManager::Get()->Play(chromeos::SOUND_DICTATION_CANCEL);
speech_recognizer_.reset();
return false;
}
......@@ -57,6 +57,7 @@ void DictationChromeos::OnSpeechResult(const base::string16& query,
if (input_context)
input_context->CommitText(base::UTF16ToASCII(query));
media::SoundsManager::Get()->Play(chromeos::SOUND_DICTATION_END);
chromeos::AccessibilityStatusEventDetails details(
chromeos::AccessibilityNotificationType::ACCESSIBILITY_TOGGLE_DICTATION,
/*enabled=*/false);
......
......@@ -28,6 +28,7 @@ enum {
SOUND_COUNT,
SOUND_DICTATION_END,
SOUND_DICTATION_START,
SOUND_DICTATION_CANCEL,
};
} // namespace chromeos
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment