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 XWALK_RUNTIME_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
6 #define XWALK_RUNTIME_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
10 #include "content/public/browser/speech_recognition_event_listener.h"
11 #include "content/public/browser/speech_recognition_manager_delegate.h"
12 #include "content/public/browser/speech_recognition_session_config.h"
16 // This is CrossWalk's implementation of the SpeechRecognitionManagerDelegate
18 class XWalkSpeechRecognitionManagerDelegate
19 : public content::SpeechRecognitionManagerDelegate {
21 XWalkSpeechRecognitionManagerDelegate();
22 virtual ~XWalkSpeechRecognitionManagerDelegate();
25 // SpeechRecognitionManagerDelegate methods.
26 virtual void GetDiagnosticInformation(bool* can_report_metrics,
27 std::string* hardware_info) OVERRIDE;
28 virtual void CheckRecognitionIsAllowed(
30 base::Callback<void(bool ask_user, bool is_allowed)> callback) OVERRIDE;
31 virtual content::SpeechRecognitionEventListener* GetEventListener() OVERRIDE;
32 virtual bool FilterProfanities(int render_process_id) OVERRIDE;
35 // Checks for VIEW_TYPE_TAB_CONTENTS host in the UI thread and notifies back
36 // the result in the IO thread through |callback|.
37 static void CheckRenderViewType(
38 base::Callback<void(bool ask_user, bool is_allowed)> callback,
39 int render_process_id,
42 DISALLOW_COPY_AND_ASSIGN(XWalkSpeechRecognitionManagerDelegate);
47 #endif // XWALK_RUNTIME_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_