Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: chrome/browser/chromeos/accessibility/speech_monitor.cc

Issue 2449043004: Explicitly skip notification announcements in SpokenFeedbackTest (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/chromeos/accessibility/speech_monitor.h" 5 #include "chrome/browser/chromeos/accessibility/speech_monitor.h"
6 6
7 namespace chromeos { 7 namespace chromeos {
8 8
9 namespace { 9 namespace {
10 const char kChromeVoxEnabledMessage[] = "chrome vox spoken feedback is ready"; 10 const char kChromeVoxEnabledMessage[] = "chrome vox spoken feedback is ready";
11 const char kChromeVoxAlertMessage[] = "Alert";
12 const char kChromeVoxUpdate1[] = "chrome vox Updated Press chrome vox o,";
13 const char kChromeVoxUpdate2[] = "n to learn more about chrome vox Next.";
11 } // namespace 14 } // namespace
12 15
13 SpeechMonitor::SpeechMonitor() { 16 SpeechMonitor::SpeechMonitor() {
14 TtsController::GetInstance()->SetPlatformImpl(this); 17 TtsController::GetInstance()->SetPlatformImpl(this);
15 } 18 }
16 19
17 SpeechMonitor::~SpeechMonitor() { 20 SpeechMonitor::~SpeechMonitor() {
18 TtsController::GetInstance()->SetPlatformImpl(TtsPlatformImpl::GetInstance()); 21 TtsController::GetInstance()->SetPlatformImpl(TtsPlatformImpl::GetInstance());
19 } 22 }
20 23
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 voice.name = "SpeechMonitor"; 84 voice.name = "SpeechMonitor";
82 voice.events.insert(TTS_EVENT_END); 85 voice.events.insert(TTS_EVENT_END);
83 } 86 }
84 87
85 std::string SpeechMonitor::error() { 88 std::string SpeechMonitor::error() {
86 return ""; 89 return "";
87 } 90 }
88 91
89 void SpeechMonitor::WillSpeakUtteranceWithVoice(const Utterance* utterance, 92 void SpeechMonitor::WillSpeakUtteranceWithVoice(const Utterance* utterance,
90 const VoiceData& voice_data) { 93 const VoiceData& voice_data) {
94 // Blacklist some phrases.
91 // Filter out empty utterances which can be used to trigger a start event from 95 // Filter out empty utterances which can be used to trigger a start event from
92 // tts as an earcon sync. 96 // tts as an earcon sync.
93 if (utterance->text() == "") 97 if (utterance->text() == "" || utterance->text() == kChromeVoxAlertMessage ||
98 utterance->text() == kChromeVoxUpdate1 ||
99 utterance->text() == kChromeVoxUpdate2)
94 return; 100 return;
95 101
96 VLOG(0) << "Speaking " << utterance->text(); 102 VLOG(0) << "Speaking " << utterance->text();
97 utterance_queue_.push_back(utterance->text()); 103 utterance_queue_.push_back(utterance->text());
98 if (loop_runner_.get()) 104 if (loop_runner_.get())
99 loop_runner_->Quit(); 105 loop_runner_->Quit();
100 } 106 }
101 107
102 } // namespace chromeos 108 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698