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

Unified Diff: content/public/browser/speech_recognition_manager_delegate.h

Issue 9972011: Speech refactoring: Reimplemented SpeechRecognitionManagerImpl as a FSM. (CL1.7) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed according to hans and jam review. Created 8 years, 8 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/public/browser/speech_recognition_manager_delegate.h
diff --git a/content/public/browser/speech_recognition_manager_delegate.h b/content/public/browser/speech_recognition_manager_delegate.h
index 7156bc2c7092247b3e0a5f07aaa1b7e8c5add019..0539ab5b445a6e9838777056766e37659cb40609 100644
--- a/content/public/browser/speech_recognition_manager_delegate.h
+++ b/content/public/browser/speech_recognition_manager_delegate.h
@@ -8,12 +8,9 @@
#include <string>
+#include "base/callback_forward.h"
#include "content/public/common/speech_recognition_error.h"
-namespace gfx {
-class Rect;
-}
-
namespace content {
struct SpeechRecognitionResult;
@@ -22,26 +19,20 @@ struct SpeechRecognitionResult;
// user's permission and for fetching optional request information.
class SpeechRecognitionManagerDelegate {
public:
- // Describes the microphone errors that are reported via ShowMicError.
- enum MicError {
- MIC_ERROR_NO_DEVICE_AVAILABLE = 0,
- MIC_ERROR_DEVICE_IN_USE
- };
-
virtual ~SpeechRecognitionManagerDelegate() {}
- // Get the optional request information if available.
- virtual void GetRequestInfo(bool* can_report_metrics,
- std::string* request_info) = 0;
+ // Get the optional diagnostic hardware information if available.
+ virtual void GetDiagnosticInformation(bool* can_report_metrics,
+ std::string* hardware_info) = 0;
- // Called when recognition has been requested from point |element_rect_| on
- // the view port for the given caller. The embedder should call the
- // StartRecognition or CancelRecognition methods on SpeechInutManager in
- // response.
- virtual void ShowRecognitionRequested(int session_id,
- int render_process_id,
- int render_view_id,
- const gfx::Rect& element_rect) = 0;
+ // Called when recognition has been requested. The source point of the view
+ // port can be retrieved looking-up the session context.
+ virtual void ShowRecognitionRequested(int session_id) = 0;
+
+ // Checks (asynchronously) if current setup allows speech recognition.
+ virtual void CheckRecognitionIsAllowed(
+ int session_id,
+ base::Callback<void(int session_id, bool is_allowed)> callback) = 0;
// Called when recognition is starting up.
virtual void ShowWarmUp(int session_id) = 0;
@@ -57,12 +48,9 @@ class SpeechRecognitionManagerDelegate {
float volume,
float noise_volume) = 0;
- // Called when no microphone has been found.
- virtual void ShowMicError(int session_id, MicError error) = 0;
-
// Called when there has been a error with the recognition.
- virtual void ShowRecognizerError(int session_id,
- SpeechRecognitionErrorCode error) = 0;
+ virtual void ShowError(int session_id,
+ const SpeechRecognitionError& error) = 0;
// Called when recognition has ended or has been canceled.
virtual void DoClose(int session_id) = 0;
« no previous file with comments | « content/public/browser/speech_recognition_manager.h ('k') | content/public/browser/speech_recognition_session_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698