summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech/speech_input_dispatcher_host.h
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-11 20:53:37 +0100
committerKristian Monsen <kristianm@google.com>2011-05-16 13:54:48 +0100
commit21d179b334e59e9a3bfcaed4c4430bef1bc5759d (patch)
tree64e2bb6da27af6a5c93ca34f6051584aafbfcb9e /chrome/browser/speech/speech_input_dispatcher_host.h
parent0c63f00edd6ed0482fd5cbcea937ca088baf7858 (diff)
downloadexternal_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.zip
external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.gz
external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.bz2
Merge Chromium at 10.0.621.0: Initial merge by git.
Change-Id: I070cc91c608dfa4a968a5a54c173260765ac8097
Diffstat (limited to 'chrome/browser/speech/speech_input_dispatcher_host.h')
-rw-r--r--chrome/browser/speech/speech_input_dispatcher_host.h36
1 files changed, 15 insertions, 21 deletions
diff --git a/chrome/browser/speech/speech_input_dispatcher_host.h b/chrome/browser/speech/speech_input_dispatcher_host.h
index 85ca5c0..51ae04c 100644
--- a/chrome/browser/speech/speech_input_dispatcher_host.h
+++ b/chrome/browser/speech/speech_input_dispatcher_host.h
@@ -5,32 +5,31 @@
#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.
+// RenderMessageFilter.
// 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:
- explicit SpeechInputDispatcherHost(int resource_message_filter_process_id);
+ class SpeechInputCallers;
+
+ explicit SpeechInputDispatcherHost(int render_process_id);
// SpeechInputManager::Delegate methods.
- void SetRecognitionResult(int caller_id,
- const SpeechInputResultArray& result);
- void DidCompleteRecording(int caller_id);
- void DidCompleteRecognition(int caller_id);
+ virtual void SetRecognitionResult(int caller_id,
+ const SpeechInputResultArray& result);
+ 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) {
@@ -38,11 +37,7 @@ class SpeechInputDispatcherHost
}
private:
- class SpeechInputCallers;
- 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,
@@ -55,8 +50,7 @@ class SpeechInputDispatcherHost
// needed.
SpeechInputManager* manager();
- int resource_message_filter_process_id_;
- SpeechInputCallers* callers_; // weak reference to a singleton.
+ int render_process_id_;
static SpeechInputManager::AccessorMethod* manager_accessor_;