diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 07:55:03 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 07:55:03 +0000 |
commit | 21e0cbf6bf480671aef2b3e07502bf665627f4ab (patch) | |
tree | 0c30a09d2f25c7a24d1407bb7bf9092ecc6104d9 /content/browser | |
parent | bf96f533df6515f9ddea3278515a77ab81c00263 (diff) | |
download | chromium_src-21e0cbf6bf480671aef2b3e07502bf665627f4ab.zip chromium_src-21e0cbf6bf480671aef2b3e07502bf665627f4ab.tar.gz chromium_src-21e0cbf6bf480671aef2b3e07502bf665627f4ab.tar.bz2 |
Enable speech input by default and remove unused code.
This CL is the same as what I submitted for M10 in http://codereview.chromium.org/6133006/, but rolled back then. We are now enabling the feature for M11.
BUG=61677
TEST=browser_tests --gtest_filter="SpeechInputBrowserTest.*"
Review URL: http://codereview.chromium.org/6610022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/speech/speech_input_browsertest.cc | 4 | ||||
-rw-r--r-- | content/browser/speech/speech_input_dispatcher_host.cc | 36 | ||||
-rw-r--r-- | content/browser/speech/speech_input_manager.h | 4 |
3 files changed, 16 insertions, 28 deletions
diff --git a/content/browser/speech/speech_input_browsertest.cc b/content/browser/speech/speech_input_browsertest.cc index 8231f3d..e28d5bd 100644 --- a/content/browser/speech/speech_input_browsertest.cc +++ b/content/browser/speech/speech_input_browsertest.cc @@ -98,6 +98,10 @@ class FakeSpeechInputManager : public SpeechInputManager { class SpeechInputBrowserTest : public InProcessBrowserTest { public: // InProcessBrowserTest methods + virtual void SetUpCommandLine(CommandLine* command_line) { + EXPECT_TRUE(!command_line->HasSwitch(switches::kDisableSpeechInput)); + } + GURL testUrl(const FilePath::CharType* filename) { const FilePath kTestDir(FILE_PATH_LITERAL("speech")); return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename)); diff --git a/content/browser/speech/speech_input_dispatcher_host.cc b/content/browser/speech/speech_input_dispatcher_host.cc index 84e2a95..d721fee 100644 --- a/content/browser/speech/speech_input_dispatcher_host.cc +++ b/content/browser/speech/speech_input_dispatcher_host.cc @@ -129,30 +129,18 @@ SpeechInputManager* SpeechInputDispatcherHost::manager() { bool SpeechInputDispatcherHost::OnMessageReceived( const IPC::Message& message, bool* message_was_ok) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - - uint32 message_type = message.type(); - if (message_type == SpeechInputHostMsg_StartRecognition::ID || - message_type == SpeechInputHostMsg_CancelRecognition::ID || - message_type == SpeechInputHostMsg_StopRecording::ID) { - if (!SpeechInputManager::IsFeatureEnabled()) { - *message_was_ok = false; - return true; - } - - may_have_pending_requests_ = true; - IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, message, - *message_was_ok) - IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StartRecognition, - OnStartRecognition) - IPC_MESSAGE_HANDLER(SpeechInputHostMsg_CancelRecognition, - OnCancelRecognition) - IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StopRecording, - OnStopRecording) - IPC_END_MESSAGE_MAP() - return true; - } - - return false; + bool handled = true; + IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, message, + *message_was_ok) + IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StartRecognition, + OnStartRecognition) + IPC_MESSAGE_HANDLER(SpeechInputHostMsg_CancelRecognition, + OnCancelRecognition) + IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StopRecording, + OnStopRecording) + IPC_MESSAGE_UNHANDLED(handled = false) + IPC_END_MESSAGE_MAP() + return handled; } void SpeechInputDispatcherHost::OnStartRecognition( diff --git a/content/browser/speech/speech_input_manager.h b/content/browser/speech/speech_input_manager.h index 951def9..c990e8c 100644 --- a/content/browser/speech/speech_input_manager.h +++ b/content/browser/speech/speech_input_manager.h @@ -31,10 +31,6 @@ class SpeechInputManager { virtual ~Delegate() {} }; - // Whether the speech input feature is enabled, based on the browser channel - // information and command line flags. - static bool IsFeatureEnabled(); - // Invokes the platform provided microphone settings UI in a non-blocking way, // via the BrowserThread::FILE thread. static void ShowAudioInputSettings(); |