Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INPUT_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/browser/browser_message_filter.h" | 9 #include "content/browser/browser_message_filter.h" |
| 10 #include "content/browser/speech/speech_input_manager.h" | 10 #include "content/browser/speech/speech_input_manager.h" |
| 11 #include "net/url_request/url_request_context_getter.h" | |
| 11 | 12 |
| 12 struct SpeechInputHostMsg_StartRecognition_Params; | 13 struct SpeechInputHostMsg_StartRecognition_Params; |
| 13 | 14 |
| 14 namespace speech_input { | 15 namespace speech_input { |
| 15 | 16 |
| 16 // SpeechInputDispatcherHost is a delegate for Speech API messages used by | 17 // SpeechInputDispatcherHost is a delegate for Speech API messages used by |
| 17 // RenderMessageFilter. | 18 // RenderMessageFilter. |
| 18 // It's the complement of SpeechInputDispatcher (owned by RenderView). | 19 // It's the complement of SpeechInputDispatcher (owned by RenderView). |
| 19 class SpeechInputDispatcherHost : public BrowserMessageFilter, | 20 class SpeechInputDispatcherHost : public BrowserMessageFilter, |
| 20 public SpeechInputManager::Delegate { | 21 public SpeechInputManager::Delegate { |
| 21 public: | 22 public: |
| 22 class SpeechInputCallers; | 23 class SpeechInputCallers; |
| 23 | 24 |
| 24 explicit SpeechInputDispatcherHost(int render_process_id); | 25 explicit SpeechInputDispatcherHost( |
|
Satish
2011/09/23 09:44:57
remove 'explicit' since you have more than 1 param
allanwoj
2011/09/23 14:12:44
Done.
| |
| 26 int render_process_id, | |
| 27 net::URLRequestContextGetter* context_getter, | |
| 28 bool censor_results); | |
| 25 | 29 |
| 26 // SpeechInputManager::Delegate methods. | 30 // SpeechInputManager::Delegate methods. |
| 27 virtual void SetRecognitionResult(int caller_id, | 31 virtual void SetRecognitionResult(int caller_id, |
| 28 const SpeechInputResultArray& result); | 32 const SpeechInputResultArray& result); |
| 29 virtual void DidCompleteRecording(int caller_id); | 33 virtual void DidCompleteRecording(int caller_id); |
| 30 virtual void DidCompleteRecognition(int caller_id); | 34 virtual void DidCompleteRecognition(int caller_id); |
| 31 | 35 |
| 32 // BrowserMessageFilter implementation. | 36 // BrowserMessageFilter implementation. |
| 33 virtual bool OnMessageReceived(const IPC::Message& message, | 37 virtual bool OnMessageReceived(const IPC::Message& message, |
| 34 bool* message_was_ok); | 38 bool* message_was_ok); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 46 void OnCancelRecognition(int render_view_id, int request_id); | 50 void OnCancelRecognition(int render_view_id, int request_id); |
| 47 void OnStopRecording(int render_view_id, int request_id); | 51 void OnStopRecording(int render_view_id, int request_id); |
| 48 | 52 |
| 49 // Returns the speech input manager to forward events to, creating one if | 53 // Returns the speech input manager to forward events to, creating one if |
| 50 // needed. | 54 // needed. |
| 51 SpeechInputManager* manager(); | 55 SpeechInputManager* manager(); |
| 52 | 56 |
| 53 int render_process_id_; | 57 int render_process_id_; |
| 54 bool may_have_pending_requests_; // Set if we received any speech IPC request | 58 bool may_have_pending_requests_; // Set if we received any speech IPC request |
| 55 | 59 |
| 60 scoped_refptr<net::URLRequestContextGetter> context_getter_; | |
| 61 bool censor_results_; | |
| 62 | |
| 56 static SpeechInputManager* manager_; | 63 static SpeechInputManager* manager_; |
| 57 | 64 |
| 58 DISALLOW_COPY_AND_ASSIGN(SpeechInputDispatcherHost); | 65 DISALLOW_COPY_AND_ASSIGN(SpeechInputDispatcherHost); |
| 59 }; | 66 }; |
| 60 | 67 |
| 61 } // namespace speech_input | 68 } // namespace speech_input |
| 62 | 69 |
| 63 #endif // CONTENT_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ | 70 #endif // CONTENT_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ |
| OLD | NEW |