blob: 219c85939948894ee8f166781652fa26ed9c473e [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2013 The Chromium Authors
[email protected]9896c552013-08-29 19:03:202// 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 Seckler8652dcd52018-09-20 10:42:287#include "content/public/browser/browser_task_traits.h"
[email protected]9896c552013-08-29 19:03:208#include "content/public/browser/browser_thread.h"
9
Mark Pilgrim6e0ef1f2017-07-12 14:31:4610using base::OnceCallback;
[email protected]9896c552013-08-29 19:03:2011
12namespace content {
13
14void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
Mark Pilgrim6e0ef1f2017-07-12 14:31:4615 int session_id,
16 OnceCallback<void(bool ask_user, bool is_allowed)> callback) {
[email protected]9896c552013-08-29 19:03:2017 // 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 Charettee7cdc5cd2020-05-27 23:35:0521 GetIOThreadTaskRunner({})->PostTask(
22 FROM_HERE, base::BindOnce(std::move(callback), false, true));
[email protected]9896c552013-08-29 19:03:2023}
24
25SpeechRecognitionEventListener*
26 ShellSpeechRecognitionManagerDelegate::GetEventListener() {
Ivan Kotenkov2c0d2bb32017-11-01 15:41:2827 return nullptr;
[email protected]9896c552013-08-29 19:03:2028}
29
30bool ShellSpeechRecognitionManagerDelegate::FilterProfanities(
31 int render_process_id) {
32 return false;
33}
34
35} // namespace content