OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 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 CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_ |
| 6 #define CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_ |
| 7 |
| 8 #include "chrome/browser/speech/tts_controller.h" |
| 9 #include "chrome/common/tts_messages.h" |
| 10 #include "content/public/browser/browser_message_filter.h" |
| 11 |
| 12 class Profile; |
| 13 |
| 14 class TtsMessageFilter |
| 15 : public content::BrowserMessageFilter, |
| 16 public UtteranceEventDelegate { |
| 17 public: |
| 18 TtsMessageFilter(int render_process_id, Profile* profile); |
| 19 |
| 20 // content::BrowserMessageFilter implementation. |
| 21 virtual void OverrideThreadForMessage( |
| 22 const IPC::Message& message, |
| 23 content::BrowserThread::ID* thread) OVERRIDE; |
| 24 virtual bool OnMessageReceived(const IPC::Message& message, |
| 25 bool* message_was_ok) OVERRIDE; |
| 26 |
| 27 // UtteranceEventDelegate implementation. |
| 28 virtual void OnTtsEvent(Utterance* utterance, |
| 29 TtsEventType event_type, |
| 30 int char_index, |
| 31 const std::string& error_message) OVERRIDE; |
| 32 |
| 33 private: |
| 34 virtual ~TtsMessageFilter(); |
| 35 |
| 36 void OnInitializeVoiceList(); |
| 37 void OnSpeak(const TtsUtteranceRequest& utterance); |
| 38 void OnPause(); |
| 39 void OnResume(); |
| 40 void OnCancel(); |
| 41 |
| 42 int render_process_id_; |
| 43 Profile* profile_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(TtsMessageFilter); |
| 46 }; |
| 47 |
| 48 #endif // CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_ |
OLD | NEW |