| Index: content/browser/speech/tts_dispatcher_host_impl.h
|
| diff --git a/content/browser/speech/tts_dispatcher_host_impl.h b/content/browser/speech/tts_dispatcher_host_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e52f40832d623db5be8c8a4bb04dcdfe9bc5b6ac
|
| --- /dev/null
|
| +++ b/content/browser/speech/tts_dispatcher_host_impl.h
|
| @@ -0,0 +1,64 @@
|
| +// Copyright (c) 2013 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_BROWSER_SPEECH_TTS_DISPATCHER_HOST_IMPL_H_
|
| +#define CONTENT_BROWSER_SPEECH_TTS_DISPATCHER_HOST_IMPL_H_
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "content/common/content_export.h"
|
| +#include "content/common/tts_messages.h"
|
| +#include "content/public/browser/browser_message_filter.h"
|
| +#include "content/public/browser/tts_dispatcher_host.h"
|
| +
|
| +namespace content {
|
| +
|
| +// TtsDispatcherHost is a delegate for Speech API messages used by
|
| +// RenderMessageFilter.
|
| +class CONTENT_EXPORT TtsDispatcherHostImpl
|
| + : public BrowserMessageFilter,
|
| + public TtsDispatcherHost {
|
| + public:
|
| + TtsDispatcherHostImpl(int render_process_id,
|
| + BrowserContext* browser_context);
|
| +
|
| + virtual BrowserContext* GetBrowserContext() OVERRIDE;
|
| +
|
| + // TtsDispatcherHost methods.
|
| + virtual void DidStartSpeaking(int utterance_id) OVERRIDE;
|
| + virtual void DidFinishSpeaking(int utterance_id) OVERRIDE;
|
| + virtual void DidPauseSpeaking(int utterance_id) OVERRIDE;
|
| + virtual void DidResumeSpeaking(int utterance_id) OVERRIDE;
|
| + virtual void WordBoundary(int utterance_id, int char_index) OVERRIDE;
|
| + virtual void SentenceBoundary(
|
| + int utterance_id, int char_index) OVERRIDE;
|
| + virtual void MarkerEvent(int utterance_id, int char_index) OVERRIDE;
|
| + virtual void WasInterrupted(int utterance_id) OVERRIDE;
|
| + virtual void WasCancelled(int utterance_id) OVERRIDE;
|
| + virtual void SpeakingErrorOccurred(
|
| + int utterance_id, const std::string& error_message) OVERRIDE;
|
| + virtual void SendVoiceList(const std::vector<content::TtsVoice>&) OVERRIDE;
|
| +
|
| + // BrowserMessageFilter implementation.
|
| + virtual bool OnMessageReceived(const IPC::Message& message,
|
| + bool* message_was_ok) OVERRIDE;
|
| +
|
| + private:
|
| + virtual ~TtsDispatcherHostImpl();
|
| +
|
| + void OnInitializeVoiceList();
|
| + void OnSpeak(const TtsUtteranceRequest& utterance);
|
| + void OnPause();
|
| + void OnResume();
|
| + void OnCancel();
|
| +
|
| + int render_process_id_;
|
| + BrowserContext* browser_context_;
|
| + TtsDispatcherHostDelegate* delegate_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TtsDispatcherHostImpl);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_SPEECH_TTS_DISPATCHER_HOST_IMPL_H_
|
|
|