Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "content/shell/browser/shell_speech_recognition_manager_delegate.h" |
| 6 | |
Eric Seckler | 8652dcd5 | 2018-09-20 10:42:28 | [diff] [blame] | 7 | #include "content/public/browser/browser_task_traits.h" |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 8 | #include "content/public/browser/browser_thread.h" |
| 9 | |
Mark Pilgrim | 6e0ef1f | 2017-07-12 14:31:46 | [diff] [blame] | 10 | using base::OnceCallback; |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 11 | |
| 12 | namespace content { |
| 13 | |
| 14 | void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( |
Mark Pilgrim | 6e0ef1f | 2017-07-12 14:31:46 | [diff] [blame] | 15 | int session_id, |
| 16 | OnceCallback<void(bool ask_user, bool is_allowed)> callback) { |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 17 | // In content_shell, we expect speech recognition to happen when requested. |
| 18 | // Therefore we simply authorize it by calling back with is_allowed=true. The |
| 19 | // first parameter, ask_user, is set to false because we don't want to prompt |
| 20 | // the user for permission with an infobar. |
Gabriel Charette | e7cdc5cd | 2020-05-27 23:35:05 | [diff] [blame] | 21 | GetIOThreadTaskRunner({})->PostTask( |
| 22 | FROM_HERE, base::BindOnce(std::move(callback), false, true)); |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | SpeechRecognitionEventListener* |
| 26 | ShellSpeechRecognitionManagerDelegate::GetEventListener() { |
Ivan Kotenkov | 2c0d2bb3 | 2017-11-01 15:41:28 | [diff] [blame] | 27 | return nullptr; |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | bool ShellSpeechRecognitionManagerDelegate::FilterProfanities( |
| 31 | int render_process_id) { |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | } // namespace content |