electron_speech_recognition_manager_delegate.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2014 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
  5. #define ELECTRON_SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
  6. #include "content/public/browser/speech_recognition_event_listener.h"
  7. #include "content/public/browser/speech_recognition_manager_delegate.h"
  8. namespace electron {
  9. class ElectronSpeechRecognitionManagerDelegate
  10. : public content::SpeechRecognitionManagerDelegate {
  11. public:
  12. ElectronSpeechRecognitionManagerDelegate();
  13. ~ElectronSpeechRecognitionManagerDelegate() override;
  14. // disable copy
  15. ElectronSpeechRecognitionManagerDelegate(
  16. const ElectronSpeechRecognitionManagerDelegate&) = delete;
  17. ElectronSpeechRecognitionManagerDelegate& operator=(
  18. const ElectronSpeechRecognitionManagerDelegate&) = delete;
  19. // content::SpeechRecognitionManagerDelegate:
  20. void CheckRecognitionIsAllowed(
  21. int session_id,
  22. base::OnceCallback<void(bool ask_user, bool is_allowed)> callback)
  23. override;
  24. content::SpeechRecognitionEventListener* GetEventListener() override;
  25. void BindSpeechRecognitionContext(
  26. mojo::PendingReceiver<media::mojom::SpeechRecognitionContext> receiver)
  27. override;
  28. };
  29. } // namespace electron
  30. #endif // ELECTRON_SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_