Index: chrome/browser/speech/speech_input_dispatcher_host.h |
=================================================================== |
--- chrome/browser/speech/speech_input_dispatcher_host.h (revision 68877) |
+++ chrome/browser/speech/speech_input_dispatcher_host.h (working copy) |
@@ -5,24 +5,21 @@ |
#ifndef CHROME_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ |
#define CHROME_BROWSER_SPEECH_SPEECH_INPUT_DISPATCHER_HOST_H_ |
-#include "base/basictypes.h" |
-#include "base/ref_counted.h" |
#include "base/scoped_ptr.h" |
+#include "chrome/browser/browser_message_filter.h" |
#include "chrome/browser/speech/speech_input_manager.h" |
-#include "ipc/ipc_message.h" |
namespace speech_input { |
// SpeechInputDispatcherHost is a delegate for Speech API messages used by |
// ResourceMessageFilter. |
// It's the complement of SpeechInputDispatcher (owned by RenderView). |
-class SpeechInputDispatcherHost |
- : public base::RefCountedThreadSafe<SpeechInputDispatcherHost>, |
- public SpeechInputManager::Delegate { |
+class SpeechInputDispatcherHost : public BrowserMessageFilter, |
+ public SpeechInputManager::Delegate { |
public: |
class SpeechInputCallers; |
- explicit SpeechInputDispatcherHost(int resource_message_filter_process_id); |
+ explicit SpeechInputDispatcherHost(int render_process_id); |
// SpeechInputManager::Delegate methods. |
virtual void SetRecognitionResult(int caller_id, |
@@ -30,9 +27,9 @@ |
virtual void DidCompleteRecording(int caller_id); |
virtual void DidCompleteRecognition(int caller_id); |
- // Called to possibly handle the incoming IPC message. Returns true if |
- // handled. |
- bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok); |
+ // BrowserMessageFilter implementation. |
+ virtual bool OnMessageReceived(const IPC::Message& message, |
+ bool* message_was_ok); |
// Singleton accessor setter useful for tests. |
static void set_manager_accessor(SpeechInputManager::AccessorMethod* method) { |
@@ -40,10 +37,7 @@ |
} |
private: |
- friend class base::RefCountedThreadSafe<SpeechInputDispatcherHost>; |
- |
virtual ~SpeechInputDispatcherHost(); |
- void SendMessageToRenderView(IPC::Message* message, int render_view_id); |
void OnStartRecognition(int render_view_id, int request_id, |
const gfx::Rect& element_rect, |
@@ -56,7 +50,7 @@ |
// needed. |
SpeechInputManager* manager(); |
- int resource_message_filter_process_id_; |
+ int render_process_id_; |
static SpeechInputManager::AccessorMethod* manager_accessor_; |