| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/sync_socket.h" |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/browser_message_filter.h" | 12 #include "content/public/browser/browser_message_filter.h" |
| 12 #include "content/public/browser/speech_recognition_event_listener.h" | 13 #include "content/public/browser/speech_recognition_event_listener.h" |
| 13 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
| 14 | 15 |
| 15 struct SpeechRecognitionHostMsg_StartRequest_Params; | 16 struct SpeechRecognitionHostMsg_StartRequest_Params; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| 19 class SpeechRecognitionManager; | 20 class SpeechRecognitionManager; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 41 void OnSoundEnd(int session_id) override; | 42 void OnSoundEnd(int session_id) override; |
| 42 void OnAudioEnd(int session_id) override; | 43 void OnAudioEnd(int session_id) override; |
| 43 void OnRecognitionEnd(int session_id) override; | 44 void OnRecognitionEnd(int session_id) override; |
| 44 void OnRecognitionResults(int session_id, | 45 void OnRecognitionResults(int session_id, |
| 45 const SpeechRecognitionResults& results) override; | 46 const SpeechRecognitionResults& results) override; |
| 46 void OnRecognitionError(int session_id, | 47 void OnRecognitionError(int session_id, |
| 47 const SpeechRecognitionError& error) override; | 48 const SpeechRecognitionError& error) override; |
| 48 void OnAudioLevelsChange(int session_id, | 49 void OnAudioLevelsChange(int session_id, |
| 49 float volume, | 50 float volume, |
| 50 float noise_volume) override; | 51 float noise_volume) override; |
| 52 void OnAudioReceiverReady( |
| 53 int session_id, |
| 54 const media::AudioParameters& params, |
| 55 const base::SharedMemoryHandle memory, |
| 56 const base::SyncSocket::TransitDescriptor socket) override; |
| 51 | 57 |
| 52 // BrowserMessageFilter implementation. | 58 // BrowserMessageFilter implementation. |
| 53 void OnDestruct() const override; | 59 void OnDestruct() const override; |
| 54 bool OnMessageReceived(const IPC::Message& message) override; | 60 bool OnMessageReceived(const IPC::Message& message) override; |
| 55 void OverrideThreadForMessage(const IPC::Message& message, | 61 void OverrideThreadForMessage(const IPC::Message& message, |
| 56 BrowserThread::ID* thread) override; | 62 BrowserThread::ID* thread) override; |
| 57 | 63 |
| 58 void OnChannelClosing() override; | 64 void OnChannelClosing() override; |
| 59 | 65 |
| 60 private: | 66 private: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 82 // about this class being destroyed in the meanwhile (due to browser shutdown) | 88 // about this class being destroyed in the meanwhile (due to browser shutdown) |
| 83 // since tasks pending on a destroyed WeakPtr are automatically discarded. | 89 // since tasks pending on a destroyed WeakPtr are automatically discarded. |
| 84 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; | 90 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; |
| 85 | 91 |
| 86 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); | 92 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); |
| 87 }; | 93 }; |
| 88 | 94 |
| 89 } // namespace content | 95 } // namespace content |
| 90 | 96 |
| 91 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 97 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
| OLD | NEW |