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/speech/speech_input_manager.h" | 9 #include "content/browser/speech/speech_input_manager.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // It's the complement of SpeechInputDispatcher (owned by RenderView). | 24 // It's the complement of SpeechInputDispatcher (owned by RenderView). |
25 class SpeechInputDispatcherHost : public content::BrowserMessageFilter, | 25 class SpeechInputDispatcherHost : public content::BrowserMessageFilter, |
26 public SpeechInputManager::Delegate { | 26 public SpeechInputManager::Delegate { |
27 public: | 27 public: |
28 class SpeechInputCallers; | 28 class SpeechInputCallers; |
29 | 29 |
30 SpeechInputDispatcherHost( | 30 SpeechInputDispatcherHost( |
31 int render_process_id, | 31 int render_process_id, |
32 net::URLRequestContextGetter* context_getter, | 32 net::URLRequestContextGetter* context_getter, |
33 SpeechInputPreferences* speech_input_preferences, | 33 SpeechInputPreferences* speech_input_preferences, |
34 const content::ResourceContext* resource_context); | 34 content::ResourceContext* resource_context); |
35 | 35 |
36 // SpeechInputManager::Delegate methods. | 36 // SpeechInputManager::Delegate methods. |
37 virtual void SetRecognitionResult( | 37 virtual void SetRecognitionResult( |
38 int caller_id, | 38 int caller_id, |
39 const content::SpeechInputResult& result) OVERRIDE; | 39 const content::SpeechInputResult& result) OVERRIDE; |
40 virtual void DidCompleteRecording(int caller_id) OVERRIDE; | 40 virtual void DidCompleteRecording(int caller_id) OVERRIDE; |
41 virtual void DidCompleteRecognition(int caller_id) OVERRIDE; | 41 virtual void DidCompleteRecognition(int caller_id) OVERRIDE; |
42 | 42 |
43 // content::BrowserMessageFilter implementation. | 43 // content::BrowserMessageFilter implementation. |
44 virtual bool OnMessageReceived(const IPC::Message& message, | 44 virtual bool OnMessageReceived(const IPC::Message& message, |
(...skipping 12 matching lines...) Expand all Loading... |
57 | 57 |
58 // Returns the speech input manager to forward events to, creating one if | 58 // Returns the speech input manager to forward events to, creating one if |
59 // needed. | 59 // needed. |
60 SpeechInputManager* manager(); | 60 SpeechInputManager* manager(); |
61 | 61 |
62 int render_process_id_; | 62 int render_process_id_; |
63 bool may_have_pending_requests_; // Set if we received any speech IPC request | 63 bool may_have_pending_requests_; // Set if we received any speech IPC request |
64 | 64 |
65 scoped_refptr<net::URLRequestContextGetter> context_getter_; | 65 scoped_refptr<net::URLRequestContextGetter> context_getter_; |
66 scoped_refptr<SpeechInputPreferences> speech_input_preferences_; | 66 scoped_refptr<SpeechInputPreferences> speech_input_preferences_; |
67 const content::ResourceContext* resource_context_; | 67 content::ResourceContext* resource_context_; |
68 | 68 |
69 static SpeechInputManager* manager_; | 69 static SpeechInputManager* manager_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(SpeechInputDispatcherHost); | 71 DISALLOW_COPY_AND_ASSIGN(SpeechInputDispatcherHost); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace speech_input | 74 } // namespace speech_input |
75 | 75 |
76 #endif // CONTENT_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ | 76 #endif // CONTENT_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ |
OLD | NEW |