OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
hans
2013/03/09 14:19:52
2013 since it's a new file?
dmazzoni
2013/03/19 17:30:22
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_SPEECH_TTS_DISPATCHER_HOST_IMPL_H_ | |
6 #define CONTENT_BROWSER_SPEECH_TTS_DISPATCHER_HOST_IMPL_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "content/common/content_export.h" | |
10 #include "content/common/tts_messages.h" | |
11 #include "content/public/browser/browser_message_filter.h" | |
12 #include "content/public/browser/tts_dispatcher_host.h" | |
13 | |
14 namespace content { | |
15 | |
16 // TtsDispatcherHost is a delegate for Speech API messages used by | |
17 // RenderMessageFilter. | |
18 class CONTENT_EXPORT TtsDispatcherHostImpl | |
19 : public BrowserMessageFilter, | |
20 public TtsDispatcherHost { | |
21 public: | |
22 TtsDispatcherHostImpl(int render_process_id, | |
23 BrowserContext* browser_context); | |
24 | |
25 virtual BrowserContext* GetBrowserContext() OVERRIDE; | |
26 | |
27 // TtsDispatcherHost methods. | |
28 virtual void DidStartSpeaking(int routing_id, int utterance_id) OVERRIDE; | |
29 virtual void DidFinishSpeaking(int routing_id, int utterance_id) OVERRIDE; | |
30 virtual void DidPauseSpeaking(int routing_id, int utterance_id) OVERRIDE; | |
31 virtual void DidResumeSpeaking(int routing_id, int utterance_id) OVERRIDE; | |
32 virtual void WordBoundary( | |
33 int routing_id, int utterance_id, int char_index) OVERRIDE; | |
34 virtual void SentenceBoundary( | |
35 int routing_id, int utterance_id, int char_index) OVERRIDE; | |
36 virtual void MarkerEvent(int routing_id, int utterance_id, int char_index) | |
37 OVERRIDE; | |
38 virtual void WasInterrupted(int routing_id, int utterance_id) OVERRIDE; | |
39 virtual void WasCancelled(int routing_id, int utterance_id) OVERRIDE; | |
40 virtual void SpeakingErrorOccurred( | |
41 int routing_id, int utterance_id, const std::string& error_message) | |
42 OVERRIDE; | |
43 virtual void SendVoiceList(int routing_id, | |
44 const std::vector<content::TtsVoice>&) OVERRIDE; | |
45 | |
46 // BrowserMessageFilter implementation. | |
47 virtual bool OnMessageReceived(const IPC::Message& message, | |
48 bool* message_was_ok) OVERRIDE; | |
49 | |
50 private: | |
51 virtual ~TtsDispatcherHostImpl(); | |
52 | |
53 void OnInitializeVoiceList(int routing_id); | |
54 void OnSpeak(int routing_id, const TtsUtteranceRequest& utterance); | |
55 void OnPause(); | |
56 void OnResume(); | |
57 void OnCancel(); | |
58 | |
59 int render_process_id_; | |
60 BrowserContext* browser_context_; | |
61 TtsDispatcherHostDelegate* delegate_; | |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(TtsDispatcherHostImpl); | |
64 }; | |
65 | |
66 } // namespace content | |
67 | |
68 #endif // CONTENT_BROWSER_SPEECH_TTS_DISPATCHER_HOST_IMPL_H_ | |
OLD | NEW |