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

Side by Side Diff: content/browser/speech/speech_recognition_dispatcher_host.cc

Issue 11348275: Remove the flag for the Speech API and turn it on by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/speech/speech_recognition_dispatcher_host.h" 5 #include "content/browser/speech/speech_recognition_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "content/common/speech_recognition_messages.h" 10 #include "content/common/speech_recognition_messages.h"
(...skipping 24 matching lines...) Expand all
35 35
36 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() { 36 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() {
37 if (SpeechRecognitionManager* sr_manager = manager()) 37 if (SpeechRecognitionManager* sr_manager = manager())
38 sr_manager->AbortAllSessionsForListener(this); 38 sr_manager->AbortAllSessionsForListener(this);
39 } 39 }
40 40
41 SpeechRecognitionManager* SpeechRecognitionDispatcherHost::manager() { 41 SpeechRecognitionManager* SpeechRecognitionDispatcherHost::manager() {
42 if (manager_for_tests_) 42 if (manager_for_tests_)
43 return manager_for_tests_; 43 return manager_for_tests_;
44 44
45 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 45 return SpeechRecognitionManager::GetInstance();
46 if (command_line.HasSwitch(switches::kEnableScriptedSpeech))
47 return SpeechRecognitionManager::GetInstance();
48
49 return NULL;
50 } 46 }
51 47
52 bool SpeechRecognitionDispatcherHost::OnMessageReceived( 48 bool SpeechRecognitionDispatcherHost::OnMessageReceived(
53 const IPC::Message& message, bool* message_was_ok) { 49 const IPC::Message& message, bool* message_was_ok) {
54 bool handled = true; 50 bool handled = true;
55 IPC_BEGIN_MESSAGE_MAP_EX(SpeechRecognitionDispatcherHost, message, 51 IPC_BEGIN_MESSAGE_MAP_EX(SpeechRecognitionDispatcherHost, message,
56 *message_was_ok) 52 *message_was_ok)
57 IPC_MESSAGE_HANDLER(SpeechRecognitionHostMsg_StartRequest, 53 IPC_MESSAGE_HANDLER(SpeechRecognitionHostMsg_StartRequest,
58 OnStartRequest) 54 OnStartRequest)
59 IPC_MESSAGE_HANDLER(SpeechRecognitionHostMsg_AbortRequest, 55 IPC_MESSAGE_HANDLER(SpeechRecognitionHostMsg_AbortRequest,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, 185 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id,
190 float volume, 186 float volume,
191 float noise_volume) { 187 float noise_volume) {
192 } 188 }
193 189
194 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( 190 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete(
195 int session_id) { 191 int session_id) {
196 } 192 }
197 193
198 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698