diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 22:30:19 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 22:30:19 +0000 |
commit | 230b7efa5edf3fe5964b55ea0aa801563996d4fc (patch) | |
tree | 4ee6e0ffbbb5ca3bc5699e3adefa390279c6f357 /content/renderer/speech_input_dispatcher.h | |
parent | eb7d6dd92533eae8c2514735750ccd8d0e9c5875 (diff) | |
download | chromium_src-230b7efa5edf3fe5964b55ea0aa801563996d4fc.zip chromium_src-230b7efa5edf3fe5964b55ea0aa801563996d4fc.tar.gz chromium_src-230b7efa5edf3fe5964b55ea0aa801563996d4fc.tar.bz2 |
Move a bunch of html5 renderer code to content.
TBR=avi
Review URL: http://codereview.chromium.org/6703003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78449 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/speech_input_dispatcher.h')
-rw-r--r-- | content/renderer/speech_input_dispatcher.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/content/renderer/speech_input_dispatcher.h b/content/renderer/speech_input_dispatcher.h new file mode 100644 index 0000000..44513bb --- /dev/null +++ b/content/renderer/speech_input_dispatcher.h @@ -0,0 +1,51 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_RENDERER_SPEECH_INPUT_DISPATCHER_H_ +#define CONTENT_RENDERER_SPEECH_INPUT_DISPATCHER_H_ + +#include "base/basictypes.h" +#include "chrome/renderer/render_view_observer.h" +#include "content/common/speech_input_result.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebSpeechInputController.h" + +class GURL; + +namespace WebKit { +class WebSpeechInputListener; +} + +// SpeechInputDispatcher is a delegate for speech input messages used by WebKit. +// It's the complement of SpeechInputDispatcherHost (owned by RenderViewHost). +class SpeechInputDispatcher : public RenderViewObserver, + public WebKit::WebSpeechInputController { + public: + SpeechInputDispatcher(RenderView* render_view, + WebKit::WebSpeechInputListener* listener); + + private: + // RenderView::Observer implementation. + virtual bool OnMessageReceived(const IPC::Message& message); + + // WebKit::WebSpeechInputController. + virtual bool startRecognition(int request_id, + const WebKit::WebRect& element_rect, + const WebKit::WebString& language, + const WebKit::WebString& grammar, + const WebKit::WebSecurityOrigin& origin); + + virtual void cancelRecognition(int request_id); + virtual void stopRecording(int request_id); + + void OnSpeechRecognitionResult( + int request_id, const speech_input::SpeechInputResultArray& result); + void OnSpeechRecordingComplete(int request_id); + void OnSpeechRecognitionComplete(int request_id); + + WebKit::WebSpeechInputListener* listener_; + + DISALLOW_COPY_AND_ASSIGN(SpeechInputDispatcher); +}; + +#endif // CHROME_RENDERER_SPEECH_INPUT_DISPATCHER_H_ |