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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
10 #include "base/callback_forward.h"
11 #include "content/public/common/speech_recognition_error.h"
15 class SpeechRecognitionEventListener
;
16 struct SpeechRecognitionResult
;
18 // Allows embedders to display the current state of recognition, for getting the
19 // user's permission and for fetching optional request information.
20 class SpeechRecognitionManagerDelegate
{
22 virtual ~SpeechRecognitionManagerDelegate() {}
24 // Get the optional diagnostic hardware information if available.
25 // This is called on the IO thread.
26 virtual void GetDiagnosticInformation(bool* can_report_metrics
,
27 std::string
* hardware_info
) = 0;
29 // Checks (asynchronously) if current setup allows speech recognition.
30 // This is called on the IO thread.
31 virtual void CheckRecognitionIsAllowed(
33 base::Callback
<void(bool ask_user
, bool is_allowed
)> callback
) = 0;
35 // Checks whether the delegate is interested (returning a non nullptr ptr) or
36 // not (returning nullptr) in receiving a copy of all sessions events.
37 // This is called on the IO thread.
38 virtual SpeechRecognitionEventListener
* GetEventListener() = 0;
40 // Checks whether the speech recognition for the given renderer should filter
41 // profanities or not.
42 virtual bool FilterProfanities(int render_process_id
) = 0;
45 } // namespace content
47 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_