chromium/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h"

#include <string>

#include "base/functional/bind.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/speech_recognition_manager.h"
#include "content/public/browser/speech_recognition_session_context.h"
#include "content/public/browser/web_contents.h"
#include "media/mojo/mojom/speech_recognition_error.mojom.h"
#include "media/mojo/mojom/speech_recognition_result.mojom.h"

#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/mojom/view_type.mojom.h"
#endif

#if !BUILDFLAG(IS_ANDROID)
#include "chrome/services/speech/buildflags/buildflags.h"
#if BUILDFLAG(ENABLE_SPEECH_SERVICE)
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/speech/speech_recognition_service.h"
#include "components/soda/soda_installer.h"

#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/crosapi/mojom/speech_recognition.mojom.h"
#include "chromeos/lacros/lacros_service.h"
#else  // !BUILDFLAG(IS_CHROMEOS_LACROS)
#if BUILDFLAG(ENABLE_BROWSER_SPEECH_SERVICE)
#include "chrome/browser/speech/speech_recognition_service_factory.h"
#elif BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/speech/cros_speech_recognition_service_factory.h"
#endif  // BUILDFLAG(ENABLE_BROWSER_SPEECH_SERVICE)
#endif  // BUILDFLAG(IS_CHROMEOS_LACROS)

#endif  // BUILDFLAG(ENABLE_SPEECH_SERVICE)
#endif  // !BUILDFLAG(IS_ANDROID)

BrowserThread;
SpeechRecognitionManager;
WebContents;

namespace speech {

ChromeSpeechRecognitionManagerDelegate
::ChromeSpeechRecognitionManagerDelegate() {}

ChromeSpeechRecognitionManagerDelegate
::~ChromeSpeechRecognitionManagerDelegate() {}

void ChromeSpeechRecognitionManagerDelegate::OnRecognitionStart(
    int session_id) {}

void ChromeSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {}

void ChromeSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) {}

void ChromeSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) {}

void ChromeSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {}

void ChromeSpeechRecognitionManagerDelegate::OnRecognitionResults(
    int session_id,
    const std::vector<media::mojom::WebSpeechRecognitionResultPtr>& result) {}

void ChromeSpeechRecognitionManagerDelegate::OnRecognitionError(
    int session_id,
    const media::mojom::SpeechRecognitionError& error) {}

void ChromeSpeechRecognitionManagerDelegate::OnAudioLevelsChange(
    int session_id, float volume, float noise_volume) {}

void ChromeSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {}

void ChromeSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
    int session_id,
    base::OnceCallback<void(bool ask_user, bool is_allowed)> callback) {}

content::SpeechRecognitionEventListener*
ChromeSpeechRecognitionManagerDelegate::GetEventListener() {}

#if !BUILDFLAG(IS_ANDROID)
void ChromeSpeechRecognitionManagerDelegate::BindSpeechRecognitionContext(
    mojo::PendingReceiver<media::mojom::SpeechRecognitionContext>
        recognition_receiver) {}
#endif  // !BUILDFLAG(IS_ANDROID)

// static.
void ChromeSpeechRecognitionManagerDelegate::CheckRenderFrameType(
    base::OnceCallback<void(bool ask_user, bool is_allowed)> callback,
    int render_process_id,
    int render_frame_id) {}

}  // namespace speech