#ifndef CONTENT_RENDERER_INPUT_TAG_SPEECH_DISPATCHER_H_
#define CONTENT_RENDERER_INPUT_TAG_SPEECH_DISPATCHER_H_
#include "base/basictypes.h"
#include "content/public/common/speech_recognition_result.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/WebKit/public/web/WebSpeechInputController.h"
namespace blink {
class WebSpeechInputListener;
}
namespace content {
class RenderViewImpl;
struct SpeechRecognitionResult;
class InputTagSpeechDispatcher : public RenderViewObserver,
public blink::WebSpeechInputController {
public:
InputTagSpeechDispatcher(RenderViewImpl* render_view,
blink::WebSpeechInputListener* listener);
private:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual bool startRecognition(int request_id,
const blink::WebRect& element_rect,
const blink::WebString& language,
const blink::WebString& grammar,
const blink::WebSecurityOrigin& origin);
virtual void cancelRecognition(int request_id);
virtual void stopRecording(int request_id);
void OnSpeechRecognitionResults(
int request_id, const SpeechRecognitionResults& results);
void OnSpeechRecordingComplete(int request_id);
void OnSpeechRecognitionComplete(int request_id);
void OnSpeechRecognitionToggleSpeechInput();
blink::WebSpeechInputListener* listener_;
DISALLOW_COPY_AND_ASSIGN(InputTagSpeechDispatcher);
};
}
#endif