refactor: do not subclass ElectronSpeechRecognitionManagerDelegate from SpeechRecognitionEventListener (#42806)
All the listener functions are empty stubs (and have been since d4e3c39
)
so it doesn't seem like we need a listener?
SpeechRecognitionManagerDelegate declares this method:
> // Checks whether the delegate is interested (returning a non nullptr
> // ptr) or not (returning nullptr) in receiving a copy of all sessions
> // events. This is called on the IO thread.
> virtual SpeechRecognitionEventListener* GetEventListener() = 0;
This PR has ElectronSpeechRecognitionManagerDelegate stop subclassing
from the Listener and changes GetEventListener() to return nullptr.
This commit is contained in:
parent
48fc352bcf
commit
f9d94211bb
2 changed files with 2 additions and 49 deletions
|
@ -5,16 +5,13 @@
|
|||
#ifndef ELECTRON_SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
|
||||
#define ELECTRON_SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "content/public/browser/speech_recognition_event_listener.h"
|
||||
#include "content/public/browser/speech_recognition_manager_delegate.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
class ElectronSpeechRecognitionManagerDelegate
|
||||
: public content::SpeechRecognitionManagerDelegate,
|
||||
public content::SpeechRecognitionEventListener {
|
||||
: public content::SpeechRecognitionManagerDelegate {
|
||||
public:
|
||||
ElectronSpeechRecognitionManagerDelegate();
|
||||
~ElectronSpeechRecognitionManagerDelegate() override;
|
||||
|
@ -25,23 +22,6 @@ class ElectronSpeechRecognitionManagerDelegate
|
|||
ElectronSpeechRecognitionManagerDelegate& operator=(
|
||||
const ElectronSpeechRecognitionManagerDelegate&) = delete;
|
||||
|
||||
// content::SpeechRecognitionEventListener:
|
||||
void OnRecognitionStart(int session_id) override;
|
||||
void OnAudioStart(int session_id) override;
|
||||
void OnSoundStart(int session_id) override;
|
||||
void OnSoundEnd(int session_id) override;
|
||||
void OnAudioEnd(int session_id) override;
|
||||
void OnRecognitionEnd(int session_id) override;
|
||||
void OnRecognitionResults(
|
||||
int session_id,
|
||||
const std::vector<media::mojom::WebSpeechRecognitionResultPtr>&) override;
|
||||
void OnRecognitionError(
|
||||
int session_id,
|
||||
const media::mojom::SpeechRecognitionError& error) override;
|
||||
void OnAudioLevelsChange(int session_id,
|
||||
float volume,
|
||||
float noise_volume) override;
|
||||
|
||||
// content::SpeechRecognitionManagerDelegate:
|
||||
void CheckRecognitionIsAllowed(
|
||||
int session_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue