Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/browser/speech/speech_input_manager.h

Issue 3167011: Revert 56006 - Revert 56002 - Adds SpeechInputManagerImpl to handle requests ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ 5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_
6 #define CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ 6 #define CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
11 11
12 namespace speech_input { 12 namespace speech_input {
13 13
14 // This is the gatekeeper for speech recognition in the browser process. It 14 // This is the gatekeeper for speech recognition in the browser process. It
15 // handles requests received from various render views and makes sure only one 15 // handles requests received from various render views and makes sure only one
16 // of them can use speech recognition at a time. It also sends recognition 16 // of them can use speech recognition at a time. It also sends recognition
17 // results and status events to the render views when required. 17 // results and status events to the render views when required.
18 class SpeechInputManager { 18 class SpeechInputManager {
19 public: 19 public:
20 // Implemented by the dispatcher host to relay events to the render views. 20 // Implemented by the dispatcher host to relay events to the render views.
21 class Listener { 21 class Delegate {
22 public: 22 public:
23 virtual void SetRecognitionResult(int render_view_id, 23 virtual void SetRecognitionResult(int render_view_id,
24 const string16& value) = 0; 24 const string16& value) = 0;
25 virtual void DidCompleteRecording(int render_view_id) = 0; 25 virtual void DidCompleteRecording(int render_view_id) = 0;
26 virtual void DidCompleteRecognition(int render_view_id) = 0; 26 virtual void DidCompleteRecognition(int render_view_id) = 0;
27 }; 27 };
28 28
29 // Factory method to create new instances. 29 // Factory method to create new instances.
30 static SpeechInputManager* Create(Listener* listener); 30 static SpeechInputManager* Create(Delegate* delegate);
31 // Factory method definition useful for tests. 31 // Factory method definition useful for tests.
32 typedef SpeechInputManager* (FactoryMethod)(Listener*); 32 typedef SpeechInputManager* (FactoryMethod)(Delegate*);
33 33
34 virtual ~SpeechInputManager() {} 34 virtual ~SpeechInputManager() {}
35 35
36 // Handlers for requests from render views. 36 // Handlers for requests from render views.
37 virtual void StartRecognition(int render_view_id) = 0; 37 virtual void StartRecognition(int render_view_id) = 0;
38 virtual void CancelRecognition(int render_view_id) = 0; 38 virtual void CancelRecognition(int render_view_id) = 0;
39 virtual void StopRecording(int render_view_id) = 0; 39 virtual void StopRecording(int render_view_id) = 0;
40 }; 40 };
41 41
42 // This typedef is to workaround the issue with certain versions of
43 // Visual Studio where it gets confused between multiple Delegate
44 // classes and gives a C2500 error. (I saw this error on the try bots -
45 // the workaround was not needed for my machine).
46 typedef SpeechInputManager::Delegate SpeechInputManagerDelegate;
47
42 } // namespace speech_input 48 } // namespace speech_input
43 49
44 #endif // CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ 50 #endif // CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/speech/speech_input_dispatcher_host.h ('k') | chrome/browser/speech/speech_input_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698