Chromium Code Reviews| 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..a46d6b9c7b306a0ba15b04c89d3ba75eb12ba4b4 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 CheckRecognitionIsAllowedAsync( |
|
jam
2012/04/25 15:14:08
nit: no need to have "async" in the function name,
Primiano Tucci (use gerrit)
2012/04/25 16:55:49
Done.
|
| + 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; |