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

Unified Diff: content/browser/speech/speech_recognition_manager_impl.h

Issue 9568002: Renamed speech input implementation from to speech_recognition_*. The namespace has been renamed fr… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased from master. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/speech/speech_recognition_manager_impl.h
diff --git a/content/browser/speech/speech_input_manager_impl.h b/content/browser/speech/speech_recognition_manager_impl.h
similarity index 63%
rename from content/browser/speech/speech_input_manager_impl.h
rename to content/browser/speech/speech_recognition_manager_impl.h
index 6675fb8c08489d047e25fd10391c9d8995b586c5..8b910296d742225f762330ed7cb72827b6f04c78 100644
--- a/content/browser/speech/speech_input_manager_impl.h
+++ b/content/browser/speech/speech_recognition_manager_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_
-#define CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_
+#ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_H_
+#define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_H_
#include <map>
#include <string>
@@ -12,7 +12,7 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
-#include "content/public/browser/speech_input_manager.h"
+#include "content/public/browser/speech_recognition_manager.h"
#include "content/public/browser/speech_recognizer_delegate.h"
#include "ui/gfx/rect.h"
@@ -20,32 +20,32 @@ class AudioManager;
namespace content {
class ResourceContext;
-class SpeechInputManagerDelegate;
-class SpeechInputPreferences;
-struct SpeechInputResult;
+class SpeechRecognitionManagerDelegate;
+class SpeechRecognitionPreferences;
+struct SpeechRecognitionResult;
}
namespace net {
class URLRequestContextGetter;
}
-namespace speech_input {
+namespace speech {
-class SpeechInputDispatcherHost;
+class InputTagSpeechDispatcherHost;
class SpeechRecognizerImpl;
-class CONTENT_EXPORT SpeechInputManagerImpl
- : NON_EXPORTED_BASE(public content::SpeechInputManager),
+class CONTENT_EXPORT SpeechRecognitionManagerImpl
+ : NON_EXPORTED_BASE(public content::SpeechRecognitionManager),
NON_EXPORTED_BASE(public content::SpeechRecognizerDelegate) {
public:
- static SpeechInputManagerImpl* GetInstance();
+ static SpeechRecognitionManagerImpl* GetInstance();
- // SpeechInputManager implementation:
+ // SpeechRecognitionManager implementation:
virtual void StartRecognitionForRequest(int caller_id) OVERRIDE;
virtual void CancelRecognitionForRequest(int caller_id) OVERRIDE;
virtual void FocusLostForRequest(int caller_id) OVERRIDE;
virtual bool HasAudioInputDevices() OVERRIDE;
- virtual bool IsRecordingInProcess() OVERRIDE;
+ virtual bool IsCapturingAudio() OVERRIDE;
virtual string16 GetAudioInputDeviceModel() OVERRIDE;
virtual void ShowAudioInputSettings() OVERRIDE;
@@ -58,7 +58,7 @@ class CONTENT_EXPORT SpeechInputManagerImpl
// |element_rect| is the display bounds of the html element requesting speech
// input (in page coordinates).
virtual void StartRecognition(
- SpeechInputDispatcherHost* delegate,
+ InputTagSpeechDispatcherHost* delegate,
int caller_id,
int render_process_id,
int render_view_id,
@@ -67,63 +67,63 @@ class CONTENT_EXPORT SpeechInputManagerImpl
const std::string& grammar,
const std::string& origin_url,
net::URLRequestContextGetter* context_getter,
- content::SpeechInputPreferences* speech_input_prefs);
+ content::SpeechRecognitionPreferences* speech_recognition_prefs);
virtual void CancelRecognition(int caller_id);
virtual void CancelAllRequestsWithDelegate(
- SpeechInputDispatcherHost* delegate);
+ InputTagSpeechDispatcherHost* delegate);
virtual void StopRecording(int caller_id);
// Overridden from content::SpeechRecognizerDelegate:
virtual void DidStartReceivingAudio(int caller_id) OVERRIDE;
virtual void SetRecognitionResult(
- int caller_id,
- const content::SpeechInputResult& result) OVERRIDE;
+ int caller_id, const content::SpeechRecognitionResult& result) OVERRIDE;
virtual void DidCompleteRecording(int caller_id) OVERRIDE;
virtual void DidCompleteRecognition(int caller_id) OVERRIDE;
virtual void DidStartReceivingSpeech(int caller_id) OVERRIDE;
virtual void DidStopReceivingSpeech(int caller_id) OVERRIDE;
- virtual void OnRecognizerError(int caller_id,
- content::SpeechInputError error) OVERRIDE;
+ virtual void OnRecognizerError(
+ int caller_id, content::SpeechRecognitionErrorCode error) OVERRIDE;
virtual void DidCompleteEnvironmentEstimation(int caller_id) OVERRIDE;
virtual void SetInputVolume(int caller_id, float volume,
float noise_volume) OVERRIDE;
protected:
// Private constructor to enforce singleton.
- friend struct DefaultSingletonTraits<SpeechInputManagerImpl>;
- SpeechInputManagerImpl();
- virtual ~SpeechInputManagerImpl();
+ friend struct DefaultSingletonTraits<SpeechRecognitionManagerImpl>;
+ SpeechRecognitionManagerImpl();
+ virtual ~SpeechRecognitionManagerImpl();
bool HasPendingRequest(int caller_id) const;
private:
- struct SpeechInputRequest {
- SpeechInputRequest();
- ~SpeechInputRequest();
+ struct Request {
+ Request();
+ ~Request();
- SpeechInputDispatcherHost* delegate;
+ InputTagSpeechDispatcherHost* delegate;
scoped_refptr<SpeechRecognizerImpl> recognizer;
bool is_active; // Set to true when recording or recognition is going on.
};
- struct SpeechInputParams;
+ struct SpeechRecognitionParams;
- SpeechInputDispatcherHost* GetDelegate(int caller_id) const;
+ InputTagSpeechDispatcherHost* GetDelegate(int caller_id) const;
- void CheckRenderViewTypeAndStartRecognition(const SpeechInputParams& params);
- void ProceedStartingRecognition(const SpeechInputParams& params);
+ void CheckRenderViewTypeAndStartRecognition(
+ const SpeechRecognitionParams& params);
+ void ProceedStartingRecognition(const SpeechRecognitionParams& params);
void CancelRecognitionAndInformDelegate(int caller_id);
- typedef std::map<int, SpeechInputRequest> SpeechRecognizerMap;
+ typedef std::map<int, Request> SpeechRecognizerMap;
SpeechRecognizerMap requests_;
std::string request_info_;
bool can_report_metrics_;
int recording_caller_id_;
- content::SpeechInputManagerDelegate* delegate_;
+ content::SpeechRecognitionManagerDelegate* delegate_;
};
-} // namespace speech_input
+} // namespace speech
-#endif // CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_
+#endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_H_
« no previous file with comments | « content/browser/speech/speech_recognition_browsertest.cc ('k') | content/browser/speech/speech_recognition_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698