#include "extensions/browser/api/audio/audio_api.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "base/types/optional_util.h"
#include "base/values.h"
#include "components/prefs/pref_registry_simple.h"
#include "extensions/browser/api/audio/audio_device_id_calculator.h"
#include "extensions/browser/api/audio/pref_names.h"
#include "extensions/browser/event_router.h"
#include "extensions/common/api/audio.h"
namespace {
const char* const kLevelPropErrorMsg = …;
}
namespace extensions {
audio;
namespace {
std::unique_ptr<AudioDeviceIdCalculator> CreateIdCalculator(
content::BrowserContext* context) { … }
}
static base::LazyInstance<
BrowserContextKeyedAPIFactory<AudioAPI>>::DestructorAtExit g_factory = …;
void AudioAPI::RegisterUserPrefs(PrefRegistrySimple* registry) { … }
BrowserContextKeyedAPIFactory<AudioAPI>* AudioAPI::GetFactoryInstance() { … }
AudioAPI::AudioAPI(content::BrowserContext* context)
: … { … }
AudioAPI::~AudioAPI() = default;
AudioService* AudioAPI::GetService() const { … }
void AudioAPI::OnLevelChanged(const std::string& id, int level) { … }
void AudioAPI::OnMuteChanged(bool is_input, bool is_muted) { … }
void AudioAPI::OnDevicesChanged(const DeviceInfoList& devices) { … }
ExtensionFunction::ResponseAction AudioGetDevicesFunction::Run() { … }
void AudioGetDevicesFunction::OnResponse(
bool success,
std::vector<api::audio::AudioDeviceInfo> devices) { … }
ExtensionFunction::ResponseAction AudioSetActiveDevicesFunction::Run() { … }
void AudioSetActiveDevicesFunction::OnResponse(bool success) { … }
ExtensionFunction::ResponseAction AudioSetPropertiesFunction::Run() { … }
void AudioSetPropertiesFunction::OnResponse(bool success) { … }
ExtensionFunction::ResponseAction AudioSetMuteFunction::Run() { … }
void AudioSetMuteFunction::OnResponse(bool success) { … }
ExtensionFunction::ResponseAction AudioGetMuteFunction::Run() { … }
void AudioGetMuteFunction::OnResponse(bool success, bool is_muted) { … }
}