OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "content/public/common/speech_recognition_error.h" | 11 #include "content/public/common/speech_recognition_error.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 class SpeechRecognitionEventListener; | 15 class SpeechRecognitionEventListener; |
16 struct SpeechRecognitionResult; | |
17 | 16 |
18 // Allows embedders to display the current state of recognition, for getting the | 17 // Allows embedders to display the current state of recognition, for getting the |
19 // user's permission and for fetching optional request information. | 18 // user's permission and for fetching optional request information. |
20 class SpeechRecognitionManagerDelegate { | 19 class SpeechRecognitionManagerDelegate { |
21 public: | 20 public: |
22 virtual ~SpeechRecognitionManagerDelegate() {} | 21 virtual ~SpeechRecognitionManagerDelegate() {} |
23 | 22 |
24 // Checks (asynchronously) if current setup allows speech recognition. | 23 // Checks (asynchronously) if current setup allows speech recognition. |
25 // This is called on the IO thread. | 24 // This is called on the IO thread. |
26 virtual void CheckRecognitionIsAllowed( | 25 virtual void CheckRecognitionIsAllowed( |
27 int session_id, | 26 int session_id, |
28 base::Callback<void(bool ask_user, bool is_allowed)> callback) = 0; | 27 base::Callback<void(bool ask_user, bool is_allowed)> callback) = 0; |
29 | 28 |
30 // Checks whether the delegate is interested (returning a non nullptr ptr) or | 29 // Checks whether the delegate is interested (returning a non nullptr ptr) or |
31 // not (returning nullptr) in receiving a copy of all sessions events. | 30 // not (returning nullptr) in receiving a copy of all sessions events. |
32 // This is called on the IO thread. | 31 // This is called on the IO thread. |
33 virtual SpeechRecognitionEventListener* GetEventListener() = 0; | 32 virtual SpeechRecognitionEventListener* GetEventListener() = 0; |
34 | 33 |
35 // Checks whether the speech recognition for the given renderer should filter | 34 // Checks whether the speech recognition for the given renderer should filter |
36 // profanities or not. | 35 // profanities or not. |
37 virtual bool FilterProfanities(int render_process_id) = 0; | 36 virtual bool FilterProfanities(int render_process_id) = 0; |
38 }; | 37 }; |
39 | 38 |
40 } // namespace content | 39 } // namespace content |
41 | 40 |
42 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ | 41 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
OLD | NEW |