| 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 23 matching lines...) Expand all Loading... |
| 43 virtual void OnRecognitionEnd(int session_id) override; | 44 virtual void OnRecognitionEnd(int session_id) override; |
| 44 virtual void OnRecognitionResults( | 45 virtual void OnRecognitionResults( |
| 45 int session_id, | 46 int session_id, |
| 46 const SpeechRecognitionResults& results) override; | 47 const SpeechRecognitionResults& results) override; |
| 47 virtual void OnRecognitionError( | 48 virtual void OnRecognitionError( |
| 48 int session_id, | 49 int session_id, |
| 49 const SpeechRecognitionError& error) override; | 50 const SpeechRecognitionError& error) override; |
| 50 virtual void OnAudioLevelsChange(int session_id, | 51 virtual void OnAudioLevelsChange(int session_id, |
| 51 float volume, | 52 float volume, |
| 52 float noise_volume) override; | 53 float noise_volume) override; |
| 54 virtual void OnAudioReceiverReady( |
| 55 int session_id, |
| 56 const media::AudioParameters& params, |
| 57 const base::SharedMemoryHandle memory, |
| 58 const base::SyncSocket::TransitDescriptor socket) override; |
| 53 | 59 |
| 54 // BrowserMessageFilter implementation. | 60 // BrowserMessageFilter implementation. |
| 55 virtual bool OnMessageReceived(const IPC::Message& message) override; | 61 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 56 virtual void OverrideThreadForMessage( | 62 virtual void OverrideThreadForMessage( |
| 57 const IPC::Message& message, | 63 const IPC::Message& message, |
| 58 BrowserThread::ID* thread) override; | 64 BrowserThread::ID* thread) override; |
| 59 | 65 |
| 60 virtual void OnChannelClosing() override; | 66 virtual void OnChannelClosing() override; |
| 61 | 67 |
| 62 private: | 68 private: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 81 // about this class being destroyed in the meanwhile (due to browser shutdown) | 87 // about this class being destroyed in the meanwhile (due to browser shutdown) |
| 82 // since tasks pending on a destroyed WeakPtr are automatically discarded. | 88 // since tasks pending on a destroyed WeakPtr are automatically discarded. |
| 83 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; | 89 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; |
| 84 | 90 |
| 85 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); | 91 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); |
| 86 }; | 92 }; |
| 87 | 93 |
| 88 } // namespace content | 94 } // namespace content |
| 89 | 95 |
| 90 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 96 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
| OLD | NEW |