[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_SHELL_BROWSER_SHELL_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
| 6 | #define CONTENT_SHELL_BROWSER_SHELL_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
| 7 | |
| 8 | #include "base/bind.h" |
| 9 | #include "base/compiler_specific.h" |
avi | 66a0772 | 2015-12-25 23:38:12 | [diff] [blame] | 10 | #include "base/macros.h" |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 11 | #include "content/public/browser/speech_recognition_event_listener.h" |
| 12 | #include "content/public/browser/speech_recognition_manager_delegate.h" |
| 13 | |
| 14 | namespace content { |
| 15 | |
| 16 | // This is content_shell's delegate used by the speech recognition manager to |
| 17 | // check for permission to record audio. For content_shell, we always authorize |
| 18 | // speech recognition (see crbug.com/237119). |
| 19 | class ShellSpeechRecognitionManagerDelegate |
| 20 | : public SpeechRecognitionManagerDelegate { |
| 21 | public: |
| 22 | ShellSpeechRecognitionManagerDelegate() {} |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 23 | ~ShellSpeechRecognitionManagerDelegate() override {} |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 24 | |
| 25 | // SpeechRecognitionManagerDelegate methods. |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 26 | void CheckRecognitionIsAllowed( |
| 27 | int session_id, |
Mark Pilgrim | 6e0ef1f | 2017-07-12 14:31:46 | [diff] [blame] | 28 | base::OnceCallback<void(bool ask_user, bool is_allowed)> callback) |
| 29 | override; |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 30 | SpeechRecognitionEventListener* GetEventListener() override; |
| 31 | bool FilterProfanities(int render_process_id) override; |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 32 | |
| 33 | private: |
| 34 | DISALLOW_COPY_AND_ASSIGN(ShellSpeechRecognitionManagerDelegate); |
| 35 | }; |
| 36 | |
| 37 | } // namespace content |
| 38 | |
| 39 | #endif // CONTENT_SHELL_BROWSER_SHELL_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |